diff --git a/src/libprs500/ebooks/lrf/html/convert_from.py b/src/libprs500/ebooks/lrf/html/convert_from.py index 3949531b4a..c1ec331dfd 100644 --- a/src/libprs500/ebooks/lrf/html/convert_from.py +++ b/src/libprs500/ebooks/lrf/html/convert_from.py @@ -35,7 +35,7 @@ from libprs500.ebooks.BeautifulSoup import BeautifulSoup, Comment, Tag, \ from libprs500.ebooks.lrf.pylrs.pylrs import Paragraph, CR, Italic, ImageStream, \ TextBlock, ImageBlock, JumpButton, CharButton, \ Plot, Image, BlockSpace, RuledLine, BookSetting, Canvas, DropCaps, \ - LrsError + LrsError, Sup, Sub from libprs500.ebooks.lrf.pylrs.pylrs import Span as _Span from libprs500.ebooks.lrf import Book from libprs500.ebooks.lrf import option_parser as lrf_option_parser @@ -1182,6 +1182,11 @@ class HTMLConverter(object): self.current_para = Paragraph() self.current_block = self.book.create_text_block(textStyle=pb.textStyle, blockStyle=pb.blockStyle) + elif tagname in ['sub', 'sup']: + text = self.get_text(tag) + elem = Sub if tagname == 'sub' else Sup + self.current_para.append(elem(text)) + elif tagname in ['p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']: if tag.has_key('id'): target = self.book.create_text_block(textStyle=self.current_block.textStyle, diff --git a/src/libprs500/ebooks/lrf/html/demo/demo.html b/src/libprs500/ebooks/lrf/html/demo/demo.html index c1264d93c9..a9069aa3f4 100644 --- a/src/libprs500/ebooks/lrf/html/demo/demo.html +++ b/src/libprs500/ebooks/lrf/html/demo/demo.html @@ -103,7 +103,8 @@
A simple paragraph of formatted - text, with a ruled line following it. + text, with a ruled line following it. + Superscripts and Subscripts.
A @@ -122,7 +123,8 @@
A very indented paragraph
An unindented paragraph
-A default indented paragrpah
A default indented paragrpah
+