From 384123c5bc51ceef67ce5d00fd926feddf015ea5 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 13 Jan 2011 12:55:20 +0100 Subject: simplified inline uri matching --- mod/tex/context/third/rst/rst_context.lua | 9 +++++---- 1 file 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] -- cgit v1.2.3