]> granicus.if.org Git - multimarkdown/commitdiff
ADDED: Add syntax for raw source (Addresses #38)
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 9 Jun 2017 16:45:10 +0000 (12:45 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 9 Jun 2017 16:45:10 +0000 (12:45 -0400)
15 files changed:
Sources/libMultiMarkdown/html.c
Sources/libMultiMarkdown/include/libMultiMarkdown.h
Sources/libMultiMarkdown/latex.c
Sources/libMultiMarkdown/lexer.c
Sources/libMultiMarkdown/lexer.re
Sources/libMultiMarkdown/mmd.c
Sources/libMultiMarkdown/odf.c
Sources/libMultiMarkdown/token_pairs.h
Sources/libMultiMarkdown/writer.c
Sources/libMultiMarkdown/writer.h
tests/MMD6Tests/Raw Source.fodt [new file with mode: 0644]
tests/MMD6Tests/Raw Source.html [new file with mode: 0644]
tests/MMD6Tests/Raw Source.htmlc [new file with mode: 0644]
tests/MMD6Tests/Raw Source.tex [new file with mode: 0644]
tests/MMD6Tests/Raw Source.text [new file with mode: 0644]

index d611d882d789834e24cbe0f2de987cebf8b71d97..8a90a2fb93f3efeab863459e18b81a4efab2dbb1 100644 (file)
@@ -520,12 +520,38 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
                        break;
                case BLOCK_CODE_FENCED:
                        pad(out, 2, scratch);
-                       print_const("<pre><code");
 
                        temp_char = get_fence_language_specifier(t->child->child, source);
+
                        if (temp_char) {
+                               if (strncmp("{=", temp_char, 2) == 0) {
+                                       // Raw source
+                                       if (raw_filter_text_matches(temp_char, FORMAT_HTML)) {
+                                               switch (t->child->tail->type) {
+                                                       case LINE_FENCE_BACKTICK_3:
+                                                       case LINE_FENCE_BACKTICK_4:
+                                                       case LINE_FENCE_BACKTICK_5:
+                                                               temp_token = t->child->tail;
+                                                               break;
+                                                       default:
+                                                               temp_token = NULL;
+                                               }
+                                               if (temp_token) {
+                                                       d_string_append_c_array(out, &source[t->child->next->start], temp_token->start - t->child->next->start);
+                                                       scratch->padded = 1;
+                                               } else {
+                                                       d_string_append_c_array(out, &source[t->child->start + t->child->len], t->start + t->len - t->child->next->start);                                                      
+                                                       scratch->padded = 0;
+                                               }
+                                       }
+
+                                       break;
+                               }
+                               print_const("<pre><code");
                                printf(" class=\"%s\"", temp_char);
                                free(temp_char);
+                       } else {
+                               print_const("<pre><code");
                        }
 
                        print_const(">");
@@ -1059,6 +1085,17 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
                        }
                        t->child->type = TEXT_EMPTY;
                        t->child->mate->type = TEXT_EMPTY;
+
+                       if (t->next && t->next->type == PAIR_RAW_FILTER) {
+                               // Raw text?
+                               if (raw_filter_matches(t->next, source, FORMAT_HTML)) {
+                                       d_string_append_c_array(out, &(source[t->child->start + t->child->len]), t->child->mate->start - t->child->start - t->child->len);
+                               }
+                               // Skip over PAIR_RAW_FILTER
+                               scratch->skip_token = 1;
+                               break;
+                       }
+
                        print_const("<code>");
                        mmd_export_token_tree_html_raw(out, source, t->child, scratch);
                        print_const("</code>");
@@ -1091,7 +1128,9 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
 
                        free(temp_char);
                        break;
+               case PAIR_BRACE:
                case PAIR_BRACES:
+               case PAIR_RAW_FILTER:
                        mmd_export_token_tree_html(out, source, t->child, scratch);
                        break;
                case PAIR_BRACKET:
@@ -1649,6 +1688,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, scratc
                        if (t->next)
                                print_char('\n');
                        break;
+               case RAW_FILTER_LEFT:
                case TEXT_BACKSLASH:
                case TEXT_BRACE_LEFT:
                case TEXT_BRACE_RIGHT:
index 4d9f8327f1d2e5f1023df75d6f6fa2085484345e..a523c56fac1121c7da99465c451f8970a9e4b93b 100644 (file)
@@ -339,12 +339,14 @@ enum token_types {
        PAIR_BRACKET_CITATION,
        PAIR_BRACKET_IMAGE,
        PAIR_BRACKET_VARIABLE,
+       PAIR_BRACE,
        PAIR_EMPH,
        PAIR_MATH,
        PAIR_PAREN,
        PAIR_QUOTE_SINGLE,
        PAIR_QUOTE_DOUBLE,
        PAIR_QUOTE_ALT,
+       PAIR_RAW_FILTER,
        PAIR_SUBSCRIPT,
        PAIR_SUPERSCRIPT,
        PAIR_STAR,
@@ -443,6 +445,7 @@ enum token_types {
        TOC,
        
        TEXT_BACKSLASH,
+       RAW_FILTER_LEFT,
        TEXT_BRACE_LEFT,
        TEXT_BRACE_RIGHT,
        TEXT_EMPTY,
index afcec2d7e4e1f964537f0d669beda8136b5063d9..0e350e5091dca3da20e7d3b19c5749e4d2bef58e 100644 (file)
@@ -472,7 +472,31 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                        pad(out, 2, scratch);
 
                        temp_char = get_fence_language_specifier(t->child->child, source);
+
                        if (temp_char) {
+                               if (strncmp("{=", temp_char, 2) == 0) {
+                                       // Raw source
+                                       if (raw_filter_text_matches(temp_char, FORMAT_LATEX)) {
+                                               switch (t->child->tail->type) {
+                                                       case LINE_FENCE_BACKTICK_3:
+                                                       case LINE_FENCE_BACKTICK_4:
+                                                       case LINE_FENCE_BACKTICK_5:
+                                                               temp_token = t->child->tail;
+                                                               break;
+                                                       default:
+                                                               temp_token = NULL;
+                                               }
+                                               if (temp_token) {
+                                                       d_string_append_c_array(out, &source[t->child->next->start], temp_token->start - t->child->next->start);
+                                                       scratch->padded = 1;
+                                               } else {
+                                                       d_string_append_c_array(out, &source[t->child->start + t->child->len], t->start + t->len - t->child->next->start);                                                      
+                                                       scratch->padded = 0;
+                                               }
+                                       }
+
+                                       break;
+                               }
                                printf("\\begin{lstlisting}[language=%s]\n", temp_char);
                        } else {
                                print_const("\\begin{verbatim}\n");
@@ -1012,10 +1036,22 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                        }
                        t->child->type = TEXT_EMPTY;
                        t->child->mate->type = TEXT_EMPTY;
+
+                       if (t->next && t->next->type == PAIR_RAW_FILTER) {
+                               // Raw text?
+                               if (raw_filter_matches(t->next, source, FORMAT_LATEX)) {
+                                       d_string_append_c_array(out, &(source[t->child->start + t->child->len]), t->child->mate->start - t->child->start - t->child->len);
+                               }
+                               // Skip over PAIR_RAW_FILTER
+                               scratch->skip_token = 1;
+                               break;
+                       }
+
                        print_const("\\texttt{");
                        mmd_export_token_tree_latex_tt(out, source, t->child, scratch);
                        print_const("}");
                        break;
+               case PAIR_BRACE:
                case PAIR_BRACES:
                        mmd_export_token_tree_latex(out, source, t->child, scratch);
                        break;
@@ -1617,6 +1653,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat
                case TEXT_BRACE_LEFT:
                case TEXT_BRACE_RIGHT:
                        print_const("\\");
+               case RAW_FILTER_LEFT:
                case TEXT_NUMBER_POSS_LIST:
                case TEXT_PERIOD:
                case TEXT_PLAIN:
index 7c844c0bff1f61280c1b449f9f3ccc03efd01b51..9fc7daadde53ff365d0521a9df689dd05037f73f 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.14.3 on Tue May 30 21:57:22 2017 */
+/* Generated by re2c 0.14.3 on Fri Jun  9 07:53:59 2017 */
 /**
 
        MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more.
@@ -284,18 +284,18 @@ yy2:
        case 14:        goto yy128;
        case 15:        goto yy135;
        case 16:        goto yy145;
-       default:        goto yy300;
+       default:        goto yy302;
        }
 yy3:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case '+':       goto yy305;
-       case '-':       goto yy304;
-       case '=':       goto yy301;
-       case '>':       goto yy303;
-       case '{':       goto yy299;
-       case '~':       goto yy302;
+       case '+':       goto yy306;
+       case '-':       goto yy305;
+       case '=':       goto yy299;
+       case '>':       goto yy304;
+       case '{':       goto yy301;
+       case '~':       goto yy303;
        default:        goto yy4;
        }
 yy4:
@@ -1889,69 +1889,74 @@ yy297:
        ++YYCURSOR;
        { return CRITIC_ADD_CLOSE; }
 yy299:
-       yyaccept = 17;
-       yych = *(YYMARKER = ++YYCURSOR);
-       switch (yych) {
-       case 'T':       goto yy316;
+       ++YYCURSOR;
+       switch ((yych = *YYCURSOR)) {
+       case '=':       goto yy321;
        default:        goto yy300;
        }
 yy300:
-       { return BRACE_DOUBLE_LEFT; }
+       { return RAW_FILTER_LEFT; }
 yy301:
-       yych = *++YYCURSOR;
+       yyaccept = 17;
+       yych = *(YYMARKER = ++YYCURSOR);
        switch (yych) {
-       case '=':       goto yy314;
-       default:        goto yy2;
+       case 'T':       goto yy315;
+       default:        goto yy302;
        }
 yy302:
-       yych = *++YYCURSOR;
-       switch (yych) {
-       case '~':       goto yy312;
-       default:        goto yy2;
-       }
+       { return BRACE_DOUBLE_LEFT; }
 yy303:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '>':       goto yy310;
+       case '~':       goto yy313;
        default:        goto yy2;
        }
 yy304:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '-':       goto yy308;
+       case '>':       goto yy311;
        default:        goto yy2;
        }
 yy305:
        yych = *++YYCURSOR;
        switch (yych) {
-       case '+':       goto yy306;
+       case '-':       goto yy309;
        default:        goto yy2;
        }
 yy306:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case '+':       goto yy307;
+       default:        goto yy2;
+       }
+yy307:
        ++YYCURSOR;
        { return CRITIC_ADD_OPEN; }
-yy308:
+yy309:
        ++YYCURSOR;
        { return CRITIC_DEL_OPEN; }
-yy310:
+yy311:
        ++YYCURSOR;
        { return CRITIC_COM_OPEN; }
-yy312:
+yy313:
        ++YYCURSOR;
        { return CRITIC_SUB_OPEN; }
-yy314:
-       ++YYCURSOR;
-       { return CRITIC_HI_OPEN; }
+yy315:
+       yych = *++YYCURSOR;
+       switch (yych) {
+       case 'O':       goto yy316;
+       default:        goto yy2;
+       }
 yy316:
        yych = *++YYCURSOR;
        switch (yych) {
-       case 'O':       goto yy317;
+       case 'C':       goto yy317;
        default:        goto yy2;
        }
 yy317:
        yych = *++YYCURSOR;
        switch (yych) {
-       case 'C':       goto yy318;
+       case '}':       goto yy318;
        default:        goto yy2;
        }
 yy318:
@@ -1961,14 +1966,11 @@ yy318:
        default:        goto yy2;
        }
 yy319:
-       yych = *++YYCURSOR;
-       switch (yych) {
-       case '}':       goto yy320;
-       default:        goto yy2;
-       }
-yy320:
        ++YYCURSOR;
        { return TOC; }
+yy321:
+       ++YYCURSOR;
+       { return CRITIC_HI_OPEN; }
 }
 
 }
index b7259556b10798ad9eaa5a5a61c4d2f48763f19c..84f33f978b451badb327cee0800fc24af7cca30c 100644 (file)
@@ -224,6 +224,7 @@ int scan(Scanner * s, const char * stop) {
 
                '#'                                                             { return TEXT_HASH; }
                '%'                                                             { return TEXT_PERCENT; }
+               '{='                                                    { return RAW_FILTER_LEFT; }
                '{'                                                             { return TEXT_BRACE_LEFT; }
                '}'                                                             { return TEXT_BRACE_RIGHT; }
                '\\'                                                    { return TEXT_BACKSLASH; }
index 123e0d97140ddf3764769a31e532e6cbe1c20dfa..4ca0c94a21d243c52be666370a003ba0206e492e 100644 (file)
@@ -177,6 +177,11 @@ mmd_engine * mmd_engine_create(DString * d, unsigned long extensions) {
                        token_pair_engine_add_pairing(e->pairings4, SUBSCRIPT, SUBSCRIPT, PAIR_SUBSCRIPT, PAIRING_PRUNE_MATCH);
                }
 
+               // Text Braces -- for raw text syntax
+               if (!(extensions & EXT_COMPATIBILITY)) {
+                       token_pair_engine_add_pairing(e->pairings4, TEXT_BRACE_LEFT, TEXT_BRACE_RIGHT, PAIR_BRACE, PAIRING_PRUNE_MATCH);
+                       token_pair_engine_add_pairing(e->pairings4, RAW_FILTER_LEFT, TEXT_BRACE_RIGHT, PAIR_RAW_FILTER, PAIRING_PRUNE_MATCH);
+               }
        }
 
        return e;
index 479c329d30c160271ac72e3cdf2ef34cff184762..59810b2cd173f421213ec6c107c0adaa4b58a90f 100644 (file)
@@ -417,6 +417,37 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
                        break;
                case BLOCK_CODE_FENCED:
                        pad(out, 2, scratch);
+
+                       temp_char = get_fence_language_specifier(t->child->child, source);
+
+                       if (temp_char) {
+                               if (strncmp("{=", temp_char, 2) == 0) {
+                                       // Raw source
+                                       if (raw_filter_text_matches(temp_char, FORMAT_HTML)) {
+                                               switch (t->child->tail->type) {
+                                                       case LINE_FENCE_BACKTICK_3:
+                                                       case LINE_FENCE_BACKTICK_4:
+                                                       case LINE_FENCE_BACKTICK_5:
+                                                               temp_token = t->child->tail;
+                                                               break;
+                                                       default:
+                                                               temp_token = NULL;
+                                               }
+                                               if (temp_token) {
+                                                       d_string_append_c_array(out, &source[t->child->next->start], temp_token->start - t->child->next->start);
+                                                       scratch->padded = 1;
+                                               } else {
+                                                       d_string_append_c_array(out, &source[t->child->start + t->child->len], t->start + t->len - t->child->next->start);                                                      
+                                                       scratch->padded = 0;
+                                               }
+                                       }
+
+                                       break;
+                               }
+                       }
+                       
+                       free(temp_char);
+
                        print_const("<text:p text:style-name=\"Preformatted Text\">");
                        mmd_export_token_tree_odf_raw(out, source, t->child->next, scratch);
                        print_const("</text:p>");
@@ -950,10 +981,22 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
                        }
                        t->child->type = TEXT_EMPTY;
                        t->child->mate->type = TEXT_EMPTY;
+
+                       if (t->next && t->next->type == PAIR_RAW_FILTER) {
+                               // Raw text?
+                               if (raw_filter_matches(t->next, source, FORMAT_ODF)) {
+                                       d_string_append_c_array(out, &(source[t->child->start + t->child->len]), t->child->mate->start - t->child->start - t->child->len);
+                               }
+                               // Skip over PAIR_RAW_FILTER
+                               scratch->skip_token = 1;
+                               break;
+                       }
+
                        print_const("<text:span text:style-name=\"Source_20_Text\">");
                        mmd_export_token_tree_odf_raw(out, source, t->child, scratch);
                        print_const("</text:span>");
                        break;
+               case PAIR_BRACE:
                case PAIR_BRACES:
                        mmd_export_token_tree_odf(out, source, t->child, scratch);
                        break;
@@ -1525,6 +1568,7 @@ void mmd_export_token_odf(DString * out, const char * source, token * t, scratch
                        if (t->next)
                                print_char('\n');
                        break;
+               case RAW_FILTER_LEFT:
                case TEXT_BACKSLASH:
                case TEXT_BRACE_LEFT:
                case TEXT_BRACE_RIGHT:
index 67fc76a922ac84bd5c279c0d1b355838d555be94..4de480e454d3a088ec7d5dbb52ad2521b55816fc 100644 (file)
@@ -65,7 +65,7 @@
 #include "CuTest.h"
 #endif
 
-#define kMaxTokenTypes 200                             //!< This needs to be larger than the largest token type being used
+#define kMaxTokenTypes 230                             //!< This needs to be larger than the largest token type being used
 #define kLargeStackThreshold 1000              //!< Avoid unnecessary searches of large stacks
 #define kMaxPairRecursiveDepth 1000            //!< Maximum recursion depth to traverse when pairing tokens -- to prevent stack overflow with "pathologic" input
 
index 89dd31418854296d6880d4b9ea4031808ab963f9..4539eb50ebd132439cd25b66be72eabc183a4be7 100644 (file)
@@ -2423,3 +2423,55 @@ void store_asset(scratch_pad * scratch, char * url) {
        }
 }
 
+
+bool raw_filter_text_matches(char * pattern, short format) {
+       if (!pattern)
+               return false;
+
+       if (strcmp("*", pattern) == 0) {
+               return true;
+       } else if (strcmp("{=*}", pattern) == 0) {
+               return true;
+       } else {
+               switch(format){
+                       case FORMAT_HTML:
+                               if (strstr(pattern, "html"))
+                                       return true;
+                               break;
+                       case FORMAT_ODF:
+                               if (strstr(pattern, "odf"))
+                                       return true;
+                               break;
+                       case FORMAT_EPUB:
+                               if (strstr(pattern, "epub"))
+                                       return true;
+                               break;
+                       case FORMAT_MEMOIR:
+                       case FORMAT_BEAMER:
+                       case FORMAT_LATEX:
+                               if (strstr(pattern, "latex"))
+                                       return true;
+                               break;
+               }
+       }
+
+       return false;
+}
+
+
+/// Determine whether raw filter matches specified format
+bool raw_filter_matches(token * t, const char * source, short format) {
+       bool result = false;
+
+       if (t->type != PAIR_RAW_FILTER)
+               return result;
+
+       char * pattern = my_strndup(&source[t->child->start + 2], t->child->mate->start - t->child->start - 2);
+
+       result = raw_filter_text_matches(pattern, format);
+
+       free(pattern);
+
+       return result;
+}
+
index cc4ce29a740159460a7e7d3761a76b2824a75f7a..7771cf16f62f7ecbc8a8a8144b6b3d769123755f 100644 (file)
@@ -250,5 +250,9 @@ void store_asset(scratch_pad * scratch_pad, char * url);
 asset * extract_asset(scratch_pad * scratch, char * url);
 void asset_free(asset * a);
 
+bool raw_filter_text_matches(char * pattern, short format);
+bool raw_filter_matches(token * filter, const char * source, short format);
+
+
 #endif
 
diff --git a/tests/MMD6Tests/Raw Source.fodt b/tests/MMD6Tests/Raw Source.fodt
new file mode 100644 (file)
index 0000000..22dbb7d
--- /dev/null
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
+     xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+     xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
+     xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
+     xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
+     xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+     xmlns:xlink="http://www.w3.org/1999/xlink"
+     xmlns:dc="http://purl.org/dc/elements/1.1/"
+     xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
+     xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
+     xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
+     xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
+     xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
+     xmlns:math="http://www.w3.org/1998/Math/MathML"
+     xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+     xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+     xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
+     xmlns:ooo="http://openoffice.org/2004/office"
+     xmlns:ooow="http://openoffice.org/2004/writer"
+     xmlns:oooc="http://openoffice.org/2004/calc"
+     xmlns:dom="http://www.w3.org/2001/xml-events"
+     xmlns:xforms="http://www.w3.org/2002/xforms"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+     xmlns:rpt="http://openoffice.org/2005/report"
+     xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2"
+     xmlns:xhtml="http://www.w3.org/1999/xhtml"
+     xmlns:grddl="http://www.w3.org/2003/g/data-view#"
+     xmlns:tableooo="http://openoffice.org/2009/table"
+     xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"
+     xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
+     xmlns:css3t="http://www.w3.org/TR/css3-text/"
+     office:version="1.2"
+     grddl:transformation="http://docs.oasis-open.org/office/1.2/xslt/odf2rdf.xsl"
+     office:mimetype="application/vnd.oasis.opendocument.text">
+<office:font-face-decls>
+   <style:font-face style:name="Courier New" svg:font-family="'Courier New'"
+                    style:font-adornments="Regular"
+                    style:font-family-generic="modern"
+                    style:font-pitch="fixed"/>
+</office:font-face-decls>
+<office:styles>
+<style:style style:name="Standard" style:family="paragraph" style:class="text">
+      <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.15in"     fo:text-align="justify" style:justify-single-word="false"/>
+   </style:style>
+<style:style style:name="Preformatted_20_Text" style:display-name="Preformatted Text"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0in" fo:text-align="start"
+                               style:justify-single-word="false"/>
+   <style:text-properties style:font-name="Courier New" fo:font-size="11pt"
+                          style:font-name-asian="Courier New"
+                          style:font-size-asian="11pt"
+                          style:font-name-complex="Courier New"
+                          style:font-size-complex="11pt"/>
+</style:style>
+<style:style style:name="Source_20_Text" style:display-name="Source Text"
+             style:family="text">
+   <style:text-properties style:font-name="Courier New" style:font-name-asian="Courier New"
+                          style:font-name-complex="Courier New"
+                          fo:font-size="11pt"/>
+</style:style>
+<style:style style:name="List" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="list">
+   <style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+   <style:text-properties style:font-size-asian="12pt"/>
+</style:style>
+<style:style style:name="Quotations" style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0.3937in" fo:margin-top="0in"
+                               fo:margin-bottom="0.1965in"
+                               fo:text-align="justify"                               style:justify-single-word="false"                               fo:text-indent="0in"
+                               style:auto-text-indent="false"/>
+</style:style>
+<style:style style:name="Table_20_Heading" style:display-name="Table Heading"
+             style:family="paragraph"
+             style:parent-style-name="Table_20_Contents"
+             style:class="extra">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"
+                               text:number-lines="false"
+                               text:line-number="0"/>
+   <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                          style:font-weight-complex="bold"/>
+</style:style>
+<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line"
+             style:family="paragraph"
+             style:parent-style-name="Standard"
+             style:class="html">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.1965in"
+                               style:border-line-width-bottom="0.0008in 0.0138in 0.0008in"
+                               fo:padding="0in"
+                               fo:border-left="none"
+                               fo:border-right="none"
+                               fo:border-top="none"
+                               fo:border-bottom="0.0154in double #808080"
+                               text:number-lines="false"
+                               text:line-number="0"
+                               style:join-border="false"/>
+   <style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
+</style:style>
+<style:style style:name="Footnote_20_anchor" style:display-name="Footnote anchor"              style:family="text">    <style:text-properties style:text-position="super 58%"/> </style:style>
+<style:style style:name="TOC_Item" style:family="paragraph" style:parent-style-name="Standard">
+ <style:paragraph-properties>
+  <style:tab-stops>
+   <style:tab-stop style:position="6.7283in" style:type="right" style:leader-style="dotted" style:leader-text="."/>
+  </style:tab-stops>
+ </style:paragraph-properties>
+</style:style>
+  <text:notes-configuration text:note-class="footnote" text:default-style-name="Footnote" text:citation-style-name="Footnote_20_Symbol" text:citation-body-style-name="Footnote_20_anchor" text:master-page-name="Footnote" style:num-format="a" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
+  <text:notes-configuration text:note-class="endnote" text:default-style-name="Endnote" text:citation-style-name="Endnote_20_Symbol" text:citation-body-style-name="Endnote_20_anchor" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
+</office:styles>
+<office:automatic-styles>   <style:style style:name="MMD-Italic" style:family="text">
+      <style:text-properties fo:font-style="italic" style:font-style-asian="italic"
+                             style:font-style-complex="italic"/>
+   </style:style>
+   <style:style style:name="MMD-Bold" style:family="text">
+      <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold"
+                             style:font-weight-complex="bold"/>
+   </style:style>
+   <style:style style:name="MMD-Superscript" style:family="text">
+      <style:text-properties style:text-position="super 58%"/>
+   </style:style>
+   <style:style style:name="MMD-Subscript" style:family="text">
+      <style:text-properties style:text-position="sub 58%"/>
+   </style:style>
+   <style:style style:name="Strike" style:family="text">
+      <style:text-properties style:text-line-through-style="solid" />
+   </style:style>
+   <style:style style:name="Underline" style:family="text">
+      <style:text-properties style:text-underline-style="solid" style:text-underline-color="font-color"/>
+   </style:style>
+   <style:style style:name="Highlight" style:family="text">
+      <style:text-properties fo:background-color="#FFFF00" />
+   </style:style>
+   <style:style style:name="Comment" style:family="text">
+      <style:text-properties fo:color="#0000BB" />
+   </style:style>
+<style:style style:name="MMD-Table" style:family="paragraph" style:parent-style-name="Standard">
+   <style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.05in"/>
+</style:style>
+<style:style style:name="MMD-Table-Center" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="MMD-Table-Right" style:family="paragraph" style:parent-style-name="MMD-Table">
+   <style:paragraph-properties fo:text-align="right" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L2">
+<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
+</style:style>
+<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Frame">
+   <style:graphic-properties style:print-content="true" style:vertical-pos="top"
+                             style:vertical-rel="baseline"
+                             fo:padding="0in"
+                             fo:border="none"
+                             style:shadow="none"/>
+</style:style>
+<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"
+             style:list-style-name="L1"/>
+<text:list-style style:name="L1">
+       <text:list-level-style-bullet text:level="1" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="•">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="2" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="◦">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-bullet text:level="3" text:style-name="Numbering_20_Symbols" style:num-suffix="." text:bullet-char="▪">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-bullet>
+       <text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+<text:list-style style:name="L2">
+       <text:list-level-style-number text:level="1" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="2" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="3" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="4" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="5" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="6" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="7" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="8" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="9" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+       <text:list-level-style-number text:level="10" text:style-name="Standard" style:num-suffix="." style:num-format="1">
+               <style:list-level-properties text:list-level-position-and-space-mode="label-alignment">
+                       <style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/>
+               </style:list-level-properties>
+       </text:list-level-style-number>
+</text:list-style>
+</office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Endnote" >
+    <style:header><text:h text:outline-level="2">Bibliography</text:h></style:header></style:master-page>
+  <style:master-page style:name="Footnote" style:page-layout-name="pm2"/>
+ </office:master-styles>
+<office:meta>
+       <dc:title>Raw Source</dc:title>
+</office:meta>
+<office:body>
+<office:text>
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">*foo*</text:span>{*}</text:p>
+
+<text:p text:style-name="Standard"></text:p>
+
+<text:p text:style-name="Standard"></text:p>
+
+<text:p text:style-name="Standard">*foo*</text:p>
+
+<text:p text:style-name="Standard">*foo*</text:p>
+
+<text:p text:style-name="Standard">5</text:p>
+
+<text:p text:style-name="Preformatted Text">*foo*<text:line-break/></text:p>
+
+*foo*
+
+*foo*
+
+<text:p text:style-name="Standard">10</text:p>
+
+*foo*
+
+*bar*
+
+</office:text>
+</office:body>
+</office:document>
diff --git a/tests/MMD6Tests/Raw Source.html b/tests/MMD6Tests/Raw Source.html
new file mode 100644 (file)
index 0000000..f08df02
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+       <meta charset="utf-8"/>
+       <title>Raw Source</title>
+</head>
+<body>
+
+<p><code>*foo*</code>{*}</p>
+
+<p>*foo*</p>
+
+<p></p>
+
+<p></p>
+
+<p>*foo*</p>
+
+<p>5</p>
+
+<pre><code class="{*}">*foo*
+</code></pre>
+
+*foo*
+
+*foo*
+
+<p>10</p>
+
+*foo*
+
+*bar*
+
+
+</body>
+</html>
+
diff --git a/tests/MMD6Tests/Raw Source.htmlc b/tests/MMD6Tests/Raw Source.htmlc
new file mode 100644 (file)
index 0000000..33640b3
--- /dev/null
@@ -0,0 +1,36 @@
+<p>Title:      Raw Source
+latex config:  article</p>
+
+<p><code>*foo*</code>{*}</p>
+
+<p><code>*foo*</code>{=html}</p>
+
+<p><code>*foo*</code>{=latex}</p>
+
+<p><code>*foo*</code>{=odf}</p>
+
+<p><code>*foo*</code>{=*}</p>
+
+<p>5</p>
+
+<p><code>{*}
+*foo*</code></p>
+
+<p><code>{=html}
+*foo*</code></p>
+
+<p><code>{=latex}
+*foo*</code></p>
+
+<p><code>{=odf}
+*foo*</code></p>
+
+<p><code>{=*}
+*foo*</code></p>
+
+<p>10</p>
+
+<p>```{=*}
+<em>foo</em></p>
+
+<p><em>bar</em></p>
diff --git a/tests/MMD6Tests/Raw Source.tex b/tests/MMD6Tests/Raw Source.tex
new file mode 100644 (file)
index 0000000..50a09de
--- /dev/null
@@ -0,0 +1,33 @@
+\input{mmd6-article-leader}
+\def\mytitle{Raw Source}
+\input{mmd6-article-begin}
+
+\texttt{*foo*}\{*\}
+
+
+
+*foo*
+
+
+
+*foo*
+
+5
+
+\begin{lstlisting}[language={*}]
+*foo*
+\end{lstlisting}
+
+*foo*
+
+*foo*
+
+10
+
+*foo*
+
+*bar*
+
+
+\input{mmd6-article-footer}
+\end{document}
diff --git a/tests/MMD6Tests/Raw Source.text b/tests/MMD6Tests/Raw Source.text
new file mode 100644 (file)
index 0000000..ef70c7d
--- /dev/null
@@ -0,0 +1,41 @@
+Title: Raw Source
+latex config:  article
+
+`*foo*`{*}
+
+`*foo*`{=html}
+
+`*foo*`{=latex}
+
+`*foo*`{=odf}
+
+`*foo*`{=*}
+
+5
+
+```{*}
+*foo*
+```
+
+```{=html}
+*foo*
+```
+
+```{=latex}
+*foo*
+```
+
+```{=odf}
+*foo*
+```
+
+```{=*}
+*foo*
+```
+
+10
+
+```{=*}
+*foo*
+
+*bar*