Skip to content

Commit 2f1219c

Browse files
torfjeldetecosaur
authored andcommitted
Match the end of LaTeX environments greedily
1 parent 7ec8d9d commit 2f1219c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/parse/matchers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const org_element_fallbacks = [Paragraph, List, ParagraphForced]
5656
@inline orgmatcher(::Type{FixedWidth}) = r"^([ \t]*:(?:| [^\n]*)(?:\n[ \t]*:(?:\n| [^\n]*))*)(?:\n(?:[ \t\r]*\n)*|$)"
5757
@inline orgmatcher(::Type{HorizontalRule}) = r"^[ \t]*-{5,}[ \t]*(?:\n(?:[ \t\r]*\n)*|$)"
5858
@inline orgmatcher(::Type{Keyword}) = r"^[ \t]*#\+(\S+?):(?:[ \t]+?([^\n]*))?(?:\n(?:[ \t\r]*\n)*|$)"
59-
@inline orgmatcher(::Type{LaTeXEnvironment}) = r"^([ \t]*)\\begin{([A-Za-z*]*)}([\s\S]*)\n[ \t]*\\end{\2}(?:[ \t\r\n]*\n|$)"
59+
@inline orgmatcher(::Type{LaTeXEnvironment}) = r"^([ \t]*)\\begin{([A-Za-z*]*)}([\s\S]*?)\n[ \t]*\\end{\2}(?:[ \t\r\n]*\n|$)"
6060
@inline orgmatcher(::Type{NodeProperty}) = r"^[ \t]*:([^\+\n]+)(\+)?:([ \t]+[^\n]*|[ \t]*)(?:\n(?:[ \t\r]*\n)*|$)"
6161
@inline orgmatcher(::Type{Paragraph}) = r"^[ \t]*+((?!\*+ |#\+\S|\[fn:([A-Za-z0-9-_]+)\] |[ \t]*(?:[*\-\+]|[A-Za-z]\.|\d+\.)[ \t]|:([\w\-_]+):(?:\n(?:[ \t\r]*\n)*|$)|\||#\n|# |:\n|: |[ \t]*\-{5,}[ \t]*(?:\n(?:[ \t\r]*\n)*|$)|\\begin\{)[^\n]+(?:\n[ \t]*+(?!\*+ |#\+\S|\[fn:([A-Za-z0-9-_]*)\] |[ \t]*(?:[*\-\+]|[A-Za-z]\.|\d+\.)[ \t]|:([\w\-_]+):(?:\n(?:[ \t\r]*\n)*|$)|\||#\n|# |:\n|: |[ \t]*\-{5,}[ \t]*(?:\n(?:[ \t\r]*\n)*|$)|\\begin\{)[^\n]+)*)(?:\n(?:[ \t\r]*\n)*|$)"
6262
@inline orgmatcher(::Type{TableRow}) = r"^[ \t]*(\|[^\n]*)(?:\n(?:[ \t\r]*\n)*|$)"

0 commit comments

Comments
 (0)