Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#7114 - HTML_Parser. Creates a txt file readable in the viewer.

Attached to Project: Rockbox
Opened by Gerritt Gonzales (GRaTT) - Sunday, 06 May 2007, 01:52 GMT+1
Task Type Patches
Category Plugins
Status Unconfirmed
Assigned To No-one
Player type All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Private No

Details

I have only tested this on the sansa.
The txt file created is in the same dir (name.txt),
and is very readable with the text viewer.
All tags are striped as well as extra blank spaces
and newlines are limited.
More formatting to come.
Do not forget to add the file name to SOURCES
and add to viewers.config
html,veiwers/HTML_Parser,0
htm,veiwers/HTML_Parser,0
with the icon number of your choice.
GRaTT
This task depends upon

Comment by Hepdog (007quick) - Monday, 07 May 2007, 00:56 GMT+1
Might I suggest you do those things for us. If you want stuff like this to be commited you need to make it as easy as possible to do. I would suggest that you just pick an icon for now, or have no icon.
Comment by Gerritt Gonzales (GRaTT) - Monday, 07 May 2007, 18:46 GMT+1
OK Done. This will patch against current SVN.
TODO additional formatting. It is almost not
required on these small screens.

GRaTT
Comment by Gerritt Gonzales (GRaTT) - Tuesday, 08 May 2007, 00:15 GMT+1
Added: formatting on <P> and <BR> tags.
Looks much better now.
Added: support for nested tags, it cleans up some stuff.
A bad HTML page will give a bad conversion.
If a closing > is missed then all the following text will
be discarded.

patch -p0 < HTML_ParserV1.1.diff
Nothing additional required.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Tuesday, 08 May 2007, 00:16 GMT+1
And here is the file
Comment by Gerritt Gonzales (GRaTT) - Saturday, 04 August 2007, 22:19 GMT+1
minor update
When the parser exits the created text file is highlighted
in the directory view.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Saturday, 04 August 2007, 22:27 GMT+1
one more minor update
added 2 to the filetypes array for htm and html
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 22:24 GMT+1
updated for changes to plugin directories.
Use of CATALOG file and adds htm and html fyle types.
increase file type array by two (2).
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 22:29 GMT+1
Above was supposed to say
Use of CATAGORIES file
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 08 August 2007, 10:52 GMT+1
fixes a hang if plugin run as a plugin and not a viewer.
GRaTT
Comment by Jack Suter (chrisjs169) - Saturday, 11 August 2007, 15:23 GMT+1
I know you want to advertise your other patches, but I already have the calendar patch :P

Here's a copy without part of the calendar patch:
Comment by Gerritt Gonzales (GRaTT) - Sunday, 12 August 2007, 01:18 GMT+1
Once again thanks jack.
I was heading out of town and trying to get a few things done.
I was not trying to force another patch on anyone.
GRaTT
Comment by Jack Suter (chrisjs169) - Wednesday, 15 August 2007, 00:01 GMT+1
I know, I sometimes make mistakes when I start to get rushed too =) (j/k about you trying to advertise your other patches)

-Jack
Comment by Gerritt Gonzales (GRaTT) - Monday, 20 August 2007, 16:35 GMT+1
Removed changes to filetypes.c as no longer needed.
I tried to open the text viewer automatically with the
created text file by adding the function plugin_load()
to plugin.(c/h). It worked great to open and use but on
exit of the text viewer I allways got an undef instruction.
Anybody know of a way to successfully open and close a plugin
from a plugin??
GRaTT
Comment by Thomas Martitz (kugel.) - Sunday, 18 May 2008, 02:48 GMT+1
Sync and some clean up.

Also, make sure that the trailing '\0' of your header/footer strings doesn't go into the text file, all text editor I tried (I tried some 7-8) had problems.

I also did some simplification: replace snprintf with strcpy (I wonder why you used snprintf in the first place). Also, there's no need to rb->write every single byte in a loop, just write all at once. Removed some uneeded variables.
Comment by Thomas Martitz (kugel.) - Sunday, 18 May 2008, 04:55 GMT+1
Fix red :/

Even though the simulator worked just fine, there was a weird error while compiling a test build.

Loading...