Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org: Keep all newlines #951

Merged
merged 1 commit into from Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions lexers/embedded/org_mode.xml
Expand Up @@ -228,42 +228,42 @@
</rule>
</state>
<state name="inline">
<rule pattern="(\s)*(\*[^ \n*][^*]+?[^ \n*]\*)((?=\W|\n|$))">
<rule pattern="(\s*)(\*[^ \n*][^*]+?[^ \n*]\*)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericStrong"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(/[^/]+?/)((?=\W|\n|$))">
<rule pattern="(\s*)(/[^/]+?/)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericEmph"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(=[^\n=]+?=)((?=\W|\n|$))">
<rule pattern="(\s*)(=[^\n=]+?=)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="NameClass"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(~[^\n~]+?~)((?=\W|\n|$))">
<rule pattern="(\s*)(~[^\n~]+?~)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="NameClass"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(\+[^+]+?\+)((?=\W|\n|$))">
<rule pattern="(\s*)(\+[^+]+?\+)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericDeleted"/>
<token type="Text"/>
</bygroups>
</rule>
<rule pattern="(\s)*(_[^_]+?_)((?=\W|\n|$))">
<rule pattern="(\s*)(_[^_]+?_)((?=\W|\n|$))">
<bygroups>
<token type="Text"/>
<token type="GenericUnderline"/>
Expand Down
14 changes: 14 additions & 0 deletions lexers/testdata/org.actual
Expand Up @@ -143,3 +143,17 @@ manual/Footnotes.html][page for footnotes]].
# Local Variables:
# org-link-file-path-type: relative
# End:

Generic text.

/Italicized/

*strong*

=Heading=

~Codeblock~

+StrikeTrough+

_Underlined_
15 changes: 13 additions & 2 deletions lexers/testdata/org.expected
Expand Up @@ -28,7 +28,7 @@
{"type":"NameClass","value":"=EXPORT_FILE_NAME="},
{"type":"Text","value":"\nproperty in here. But then you also lose the tag and property\ninheritance Org awesomeness.\n\nline one "},
{"type":"Operator","value":"\\\\"},
{"type":"Text","value":"\nline two\n"},
{"type":"Text","value":"\nline two\n\n"},
{"type":"GenericStrong","value":"*bold*"},
{"type":"Text","value":" "},
{"type":"GenericEmph","value":"/italics/"},
Expand Down Expand Up @@ -361,5 +361,16 @@
{"type":"Comment","value":"# org-link-file-path-type: relative"},
{"type":"Text","value":"\n"},
{"type":"Comment","value":"# End:"},
{"type":"Text","value":"\n"}
{"type":"Text","value":"\n\nGeneric text.\n\n"},
{"type":"GenericEmph","value":"/Italicized/"},
{"type":"Text","value":"\n\n"},
{"type":"GenericStrong","value":"*strong*"},
{"type":"Text","value":"\n\n"},
{"type":"NameClass","value":"=Heading="},
{"type":"Text","value":"\n\n"},
{"type":"NameClass","value":"~Codeblock~"},
{"type":"Text","value":"\n\n"},
{"type":"GenericDeleted","value":"+StrikeTrough+"},
{"type":"Text","value":"\n\n"},
{"type":"GenericUnderline","value":"_Underlined_"}
]