diff options
author | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2011-01-13 12:55:20 +0100 |
---|---|---|
committer | Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de> | 2011-01-13 12:55:20 +0100 |
commit | 384123c5bc51ceef67ce5d00fd926feddf015ea5 (patch) | |
tree | f18b84d3545e85584cda465a7c5f425e3abb17c0 /mod | |
parent | 6cd0f3907988b64f14fc86344537da62ceaeca04 (diff) | |
download | context-rst-384123c5bc51ceef67ce5d00fd926feddf015ea5.tar.gz |
simplified inline uri matching
Diffstat (limited to 'mod')
-rw-r--r-- | mod/tex/context/third/rst/rst_context.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mod/tex/context/third/rst/rst_context.lua b/mod/tex/context/third/rst/rst_context.lua index 5377d94..79c010b 100644 --- a/mod/tex/context/third/rst/rst_context.lua +++ b/mod/tex/context/third/rst/rst_context.lua @@ -371,7 +371,7 @@ local inline_parser = P{ -- Ugly but needed in case the first element of a paragraph is inline -- formatted. - inline_as_first = V"inline_do_elements" * V"succede_inline", + inline_as_first = V"inline_do_elements" * #V"succede_inline", except = P"\\starttyping" * (1 - P"\\stoptyping")^1 * P"\\stoptyping" + V"enclosed" @@ -585,13 +585,12 @@ local inline_parser = P{ -------------------------------------------------------------------------------- -- Urls -------------------------------------------------------------------------------- - uri = V"url_protocol" * V"url_domain" * (V"slash" * V"url_path")^0, + uri = V"url_protocol" * V"url_domain" * V"url_path_char"^0, url_protocol = (P"http" + P"ftp" + P"shttp" + P"sftp") * P"://", url_domain_char = 1 - V"dot" - V"spacing" - V"eol" - V"punctuation", url_domain = V"url_domain_char"^1 * (V"dot" * V"url_domain_char"^1)^0, - url_path_char = R("az", "AZ", "09") + S"-_.!~*'()", - url_path = V"slash" * (V"url_path_char"^1 * V"slash"^-1)^1, + url_path_char = R("az", "AZ", "09") + S[[-_.!~*'()/]], } rst_context.inline_parser = inline_parser @@ -972,6 +971,8 @@ end function rst_context.block_quote (tab) rst_context.addsetups("blockquote") + print(">>"..tab[1].."<<") + print(inline_parser:match(tab[1])) local str = [[ \\startlinecorrection \\blank[small] |