Skip to content

Commit

Permalink
Created new paragraphs types '\[\{\(' for the form:
Browse files Browse the repository at this point in the history
\preambulo
{
    \chooselang
    {Tese submetida
    ao Federal de \showfont}
    {Tese submetida ao asdfffffffffffffasd fdaf adsf df asfd asfd asdf sdf asdf adaf df ads fasd f Federal de \showfont}
}
  • Loading branch information
evandrocoan committed Aug 30, 2017
1 parent 2ddcdd0 commit 7af3e3b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions wrap_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,13 @@ def CONCAT(*args):
latex_hack = r'(?:\\)(?!,|;|&|%|text|emph|cite|\w?(page)?ref|url|footnote|(La)*TeX)'
rest_directive = r'(?:\.\.)'
field_start = r'(?:[:@])' # rest, javadoc, jsdoc, etc.
new_paragraph_pattern = re.compile(r'^[\t ]*' +
OR(numbered_list, lettered_list, bullet_list,
field_start))

new_paragraph_pattern_string = r'^[\t ]*' + OR(numbered_list, lettered_list, bullet_list, field_start, r'\{', r'\[', r'\(')
# print( "pattern: " + new_paragraph_pattern_string )

new_paragraph_pattern = re.compile(new_paragraph_pattern_string)
space_prefix_pattern = re.compile(r'^[ \t]*')

# XXX: Does not handle escaped colons in field name.
fields = OR(r':[^:]+:', '@[a-zA-Z]+ ')
field_pattern = re.compile(r'^([ \t]*)'+fields) # rest, javadoc, jsdoc, etc
Expand Down Expand Up @@ -252,6 +255,9 @@ def _my_full_line(self, region):
def _is_paragraph_start(self, line_r, line):
# Certain patterns at the beginning of the line indicate this is the
# beginning of a paragraph.

# print( "line: " + str( line ) )
# print( "new_paragraph_pattern.match(line): " + str( new_paragraph_pattern.match(line) ) )
return new_paragraph_pattern.match(line) != None

def _is_paragraph_break(self, line_r, line, pure=False):
Expand Down

0 comments on commit 7af3e3b

Please sign in to comment.