From cdaba1c73f0555e1128a7a35addddcfaf715dbde Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 22 Mar 2017 14:54:07 -0400 Subject: 0.13.7 tables ao and html output, poem html output --- src/sdp/ao_rgx.d | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src/sdp/ao_rgx.d') diff --git a/src/sdp/ao_rgx.d b/src/sdp/ao_rgx.d index 109b0cf..deef9c6 100644 --- a/src/sdp/ao_rgx.d +++ b/src/sdp/ao_rgx.d @@ -24,9 +24,15 @@ template SiSUrgxInit() { static newline_eol_delimiter_only = ctRegex!("^\n"); static line_delimiter_ws_strip = ctRegex!("[ ]*\n[ ]*"); static para_delimiter = ctRegex!("\n[ ]*\n+"); + static table_col_delimiter = ctRegex!("[ ]*\n+", "mg"); + static table_row_delimiter = ctRegex!("\n[ ]*\n+", "mg"); + static table_row_delimiter_special = ctRegex!("[ ]*\n", "mg"); // + static table_col_delimiter_special = ctRegex!("[ ]*[|][ ]*", "mg"); // static levels_markup = ctRegex!(`^[A-D1-4]$`); static levels_numbered = ctRegex!(`^[0-9]$`); static levels_numbered_headings = ctRegex!(`^[0-7]$`); + static numeric = ctRegex!(`[ 0-9,.-]+`); + static numeric_col = ctRegex!(`^[ 0-9,.$£₤Є€€¥-]+$`); /+ comments +/ static comment = ctRegex!(`^%+ `); static comments = ctRegex!(`^%+ |^%+$`); @@ -80,20 +86,20 @@ template SiSUrgxInit() { static para_indent_hang = ctRegex!(`^_([0-9])_([0-9]) `); static para_attribs = ctRegex!(`^_(?:(?:[0-9])(?:_([0-9]))?|(?:[1-9])?[*]) `); /+ blocked markup +/ - static block_open = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); + static block_open = ctRegex!("^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)|^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)|^[{]table(~h)?(?P(?:[ ]+[0-9]+;)+)[}]"); static block_poem_open = ctRegex!("^((poem[{].*?$)|`{3} poem)"); /+ blocked markup tics +/ static block_tic_open = ctRegex!("^`{3} (code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)"); - static block_tic_code_open = ctRegex!("^`{3} (code)([.][a-z][0-9a-z_]+)?"); + static block_tic_code_open = ctRegex!("^`{3} (?:code)(?:[.]([a-z][0-9a-z_]+))?(?:[ ]+([#]))?"); static block_tic_poem_open = ctRegex!("^`{3} (poem)"); static block_tic_group_open = ctRegex!("^`{3} (group)"); static block_tic_block_open = ctRegex!("^`{3} (block)"); static block_tic_quote_open = ctRegex!("^`{3} (quote)"); - static block_tic_table_open = ctRegex!("^`{3} (table)"); + static block_tic_table_open = ctRegex!("^`{3} table(.*)"); static block_tic_close = ctRegex!("^(`{3})$","m"); /+ blocked markup curly +/ static block_curly_open = ctRegex!(`^((code([.][a-z][0-9a-z_]+)?|poem|group|block|quote|table)[{].*?$)`); - static block_curly_code_open = ctRegex!(`^(code([.][a-z][0-9a-z_]+)?[{](.*?)$)`); + static block_curly_code_open = ctRegex!(`^(?:code(?:[.]([a-z][0-9a-z_]+))?[{]([#]?)\s*$)`); static block_curly_code_close = ctRegex!(`^([}]code)`); static block_curly_poem_open = ctRegex!(`^(poem[{].*?$)`); static block_curly_poem_close = ctRegex!(`^([}]poem)`); @@ -103,8 +109,16 @@ template SiSUrgxInit() { static block_curly_block_close = ctRegex!(`^([}]block)`); static block_curly_quote_open = ctRegex!(`^(quote[{].*?$)`); static block_curly_quote_close = ctRegex!(`^([}]quote)`); - static block_curly_table_open = ctRegex!(`^(table[{].*?$)`); + static block_curly_table_open = ctRegex!(`^table[{](.*)`); static block_curly_table_close = ctRegex!(`^([}]table)`); + static block_curly_table_special_markup = ctRegex!(`^[{]table((~h)?(?P(?:[ ]+[0-9]+;)+))[}]`, "mg"); // sepcial table block markup + static table_head_instructions = ctRegex!(`(?Ph)?(?:[ ]+c(?P[0-9]);)?(?P(?:[ ]+[0-9]+[lr]?;)+)`); + static table_col_widths_and_alignment = ctRegex!(`(?P[0-9]+)(?P[lr]?)`); + static table_col_widths = ctRegex!(`(?P[0-9]+)`); + static table_col_align = ctRegex!(`(?P[lr]?)`); + static table_col_align_match = ctRegex!(`(?P[lr])`); + static table_col_separator = ctRegex!(`┊`); + static table_col_separator_nl = ctRegex!(`[┊]$`, "mg"); /+ inline markup footnotes endnotes +/ static inline_notes_curly_gen = ctRegex!(`~\{.+?\}~`, "m"); static inline_notes_curly = ctRegex!(`~\{\s*(.+?)\}~`, "mg"); @@ -173,6 +187,8 @@ template SiSUrgxInit() { static space = ctRegex!(`[ ]`, "mg"); static two_spaces = ctRegex!(`[ ]{2}`, "mg"); static nbsp_char = ctRegex!(`░`, "mg"); + static nbsp_and_space = ctRegex!(` [ ]`, "mg"); + static nbsp_char_and_space = ctRegex!(`░[ ]`, "mg"); static src_pth = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[tm])$`); static src_fn = ctRegex!(`^([a-zA-Z0-9._-]+/)*(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`); @@ -219,5 +235,8 @@ template SiSUrgxInit() { static inline_bold_line = ctRegex!(`^!_ (?P.+?)((?: [\\]{2}|[~]#){0,2}$)`); static inline_italics_line = ctRegex!(`^/_ (?P.+?)((?: [\\]{2}|[~]#){0,2}$)`); static inline_underscore_line = ctRegex!(`^__ (?P.+?)((?: [\\]{2}|[~]#){0,2}$)`); + /+ table delimiters +/ + static table_delimiter_col = ctRegex!("[ ]*[┊][ ]*", "mg"); // + static table_delimiter_row = ctRegex!("[ ]*\n", "mg"); // } } -- cgit v1.2.3