HTML divs should end in a line break, and use hex values for binary flags

This commit is contained in:
Veronica K. B. Olsen
2021-01-24 13:41:26 +01:00
parent 98bf462e02
commit 034b4feff4
2 changed files with 21 additions and 18 deletions
+1 -1
View File
@@ -338,7 +338,7 @@ class ToHtml(Tokenizer):
)) ))
retText += ", ".join(refTags) retText += ", ".join(refTags)
return "<div>%s</div>" % retText return "<div>%s</div>\n" % retText
def _buildRegEx(self): def _buildRegEx(self):
"""Build the regular expressions """Build the regular expressions
+20 -17
View File
@@ -39,13 +39,15 @@ logger = logging.getLogger(__name__)
class Tokenizer(): class Tokenizer():
FMT_B_B = 1 # Begin bold # In-Text Format
FMT_B_E = 2 # End bold FMT_B_B = 1 # Begin bold
FMT_I_B = 3 # Begin italics FMT_B_E = 2 # End bold
FMT_I_E = 4 # End italics FMT_I_B = 3 # Begin italics
FMT_D_B = 5 # Begin strikeout FMT_I_E = 4 # End italics
FMT_D_E = 6 # End strikeout FMT_D_B = 5 # Begin strikeout
FMT_D_E = 6 # End strikeout
# Block Type
T_EMPTY = 1 # Empty line (new paragraph) T_EMPTY = 1 # Empty line (new paragraph)
T_SYNOPSIS = 2 # Synopsis comment T_SYNOPSIS = 2 # Synopsis comment
T_COMMENT = 3 # Comment line T_COMMENT = 3 # Comment line
@@ -59,17 +61,18 @@ class Tokenizer():
T_SEP = 11 # Scene separator T_SEP = 11 # Scene separator
T_SKIP = 12 # Paragraph break T_SKIP = 12 # Paragraph break
A_NONE = 0 # No special style # Block Style
A_LEFT = 1 # Left aligned A_NONE = 0x0000 # No special style
A_RIGHT = 2 # Right aligned A_LEFT = 0x0001 # Left aligned
A_CENTRE = 4 # Centred A_RIGHT = 0x0002 # Right aligned
A_JUSTIFY = 8 # Justified A_CENTRE = 0x0004 # Centred
A_PBB = 16 # Page break before always A_JUSTIFY = 0x0008 # Justified
A_PBB_AV = 32 # Page break before avoid A_PBB = 0x0010 # Page break before always
A_PBB_NO = 64 # Page break before never A_PBB_AV = 0x0020 # Page break before avoid
A_PBA = 128 # Page break after always A_PBB_NO = 0x0040 # Page break before never
A_PBA_AV = 256 # Page break after avoid A_PBA = 0x0080 # Page break after always
A_PBA_NO = 512 # Page break after avoid A_PBA_AV = 0x0100 # Page break after avoid
A_PBA_NO = 0x0200 # Page break after avoid
def __init__(self, theProject, theParent): def __init__(self, theProject, theParent):