diff --git a/src/markup/engine/__tests__/remarkup/headers.txt b/src/markup/engine/__tests__/remarkup/headers.txt index e3c2567..0c3768a 100644 --- a/src/markup/engine/__tests__/remarkup/headers.txt +++ b/src/markup/engine/__tests__/remarkup/headers.txt @@ -1,57 +1,57 @@ @nolint (UTF8) =a= blah blah blah = b = Markdown-Style Large Header ==== Markdown-Style Small Header ---- === Remarkup-Style Smaller Header = ☃☃☃ UTF8 Header ☃☃☃ = ~~~~~~~~~~

@nolint (UTF8)

-

a

+

a

blah blah blah

-

b

+

b

-

Markdown-Style Large Header

+

Markdown-Style Large Header

-

Markdown-Style Small Header

+

Markdown-Style Small Header

-

Remarkup-Style Smaller Header

+

Remarkup-Style Smaller Header

-

☃☃☃ UTF8 Header ☃☃☃

+

☃☃☃ UTF8 Header ☃☃☃

~~~~~~~~~~ @nolint (UTF8) a = blah blah blah b = Markdown-Style Large Header =========================== Markdown-Style Small Header --------------------------- Remarkup-Style Smaller Header ----------------------------- ☃☃☃ UTF8 Header ☃☃☃ =================== diff --git a/src/markup/engine/__tests__/remarkup/horizonal-rule.txt b/src/markup/engine/__tests__/remarkup/horizonal-rule.txt index b0ddc2f..93bc397 100644 --- a/src/markup/engine/__tests__/remarkup/horizonal-rule.txt +++ b/src/markup/engine/__tests__/remarkup/horizonal-rule.txt @@ -1,35 +1,35 @@ ___ _____ *** * * * * * * * --- - - - - - - - ~~~~~~~~~~ -
+
-
+
-
+
-
+
-
+
-
+
~~~~~~~~~~ -
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/markup/engine/__tests__/remarkup/link-alternate.txt b/src/markup/engine/__tests__/remarkup/link-alternate.txt index 2abcb4a..8e61291 100644 --- a/src/markup/engine/__tests__/remarkup/link-alternate.txt +++ b/src/markup/engine/__tests__/remarkup/link-alternate.txt @@ -1,12 +1,12 @@ [Example](http://www.example.com/) x[0][1](**ptr); ~~~~~~~~~~ -

Example

+

Example

x[0][1](**ptr);

~~~~~~~~~~ Example x[0][1](**ptr); diff --git a/src/markup/engine/__tests__/remarkup/link-brackets.txt b/src/markup/engine/__tests__/remarkup/link-brackets.txt index b2f48f1..3808aa9 100644 --- a/src/markup/engine/__tests__/remarkup/link-brackets.txt +++ b/src/markup/engine/__tests__/remarkup/link-brackets.txt @@ -1,5 +1,5 @@ ~~~~~~~~~~ -

http://www.zany.com/omg/weird_url,,,

+

http://www.zany.com/omg/weird_url,,,

~~~~~~~~~~ http://www.zany.com/omg/weird_url,,, diff --git a/src/markup/engine/__tests__/remarkup/link-edge-cases.txt b/src/markup/engine/__tests__/remarkup/link-edge-cases.txt index 2ee5ec3..64c93ea 100644 --- a/src/markup/engine/__tests__/remarkup/link-edge-cases.txt +++ b/src/markup/engine/__tests__/remarkup/link-edge-cases.txt @@ -1,35 +1,35 @@ http://www.example.com/ (http://www.example.com/) http://www.example.com/wiki/example_(disambiguation) (example http://www.example.com/) Quick! http://www.example.com/! ~~~~~~~~~~ -

http://www.example.com/

+

http://www.example.com/

-

(http://www.example.com/)

+

(http://www.example.com/)

-

http://www.example.com/

+

http://www.example.com/

-

http://www.example.com/wiki/example_(disambiguation)

+

http://www.example.com/wiki/example_(disambiguation)

-

(example http://www.example.com/)

+

(example http://www.example.com/)

-

Quick! http://www.example.com/!

+

Quick! http://www.example.com/!

~~~~~~~~~~ http://www.example.com/ (http://www.example.com/) http://www.example.com/ http://www.example.com/wiki/example_(disambiguation) (example http://www.example.com/) Quick! http://www.example.com/! diff --git a/src/markup/engine/__tests__/remarkup/link-mailto.txt b/src/markup/engine/__tests__/remarkup/link-mailto.txt index 95a1eb9..e449c15 100644 --- a/src/markup/engine/__tests__/remarkup/link-mailto.txt +++ b/src/markup/engine/__tests__/remarkup/link-mailto.txt @@ -1,18 +1,18 @@ [[ mailto:alincoln@example.com | mail me ]] [ mail me ]( mailto:alincoln@example.com ) [[mailto:alincoln@example.com]] ~~~~~~~~~~ -

mail me

+

mail me

-

mail me

+

mail me

-

alincoln@example.com

+

alincoln@example.com

~~~~~~~~~~ mail me mail me alincoln@example.com diff --git a/src/markup/engine/__tests__/remarkup/link-mixed.txt b/src/markup/engine/__tests__/remarkup/link-mixed.txt index 7281f89..bf433e9 100644 --- a/src/markup/engine/__tests__/remarkup/link-mixed.txt +++ b/src/markup/engine/__tests__/remarkup/link-mixed.txt @@ -1,18 +1,18 @@ [[http://www.example.com/ | Example]](http://www.alternate.org/) (http://www.alternate.org/)[[http://www.example.com/ | Example]] ~~~~~~~~~~ -

Example(http://www.alternate.org/)

+

Example(http://www.alternate.org/)

-

(http://www.alternate.org/)Example

+

(http://www.alternate.org/)Example

-

<http://www.example.com/ Example>

+

<http://www.example.com/ Example>

~~~~~~~~~~ Example (http://www.alternate.org/) (http://www.alternate.org/)Example > diff --git a/src/markup/engine/__tests__/remarkup/link-square.txt b/src/markup/engine/__tests__/remarkup/link-square.txt index dc143cd..91d85f3 100644 --- a/src/markup/engine/__tests__/remarkup/link-square.txt +++ b/src/markup/engine/__tests__/remarkup/link-square.txt @@ -1,29 +1,29 @@ [[http://www.example.com/]] [[http://www.example.com/ | example.com]] [[/]] [[#anchor]] [[#anchor | Anchors ]] ~~~~~~~~~~ -

http://www.example.com/

+

http://www.example.com/

-

example.com

+

example.com

-

/

+

/

-

#anchor

+

#anchor

-

Anchors

+

Anchors

~~~~~~~~~~ http://www.example.com/ example.com http://www.example.com/ http://www.example.com/#anchor Anchors diff --git a/src/markup/engine/__tests__/remarkup/link-with-punctuation.txt b/src/markup/engine/__tests__/remarkup/link-with-punctuation.txt index 33cb6fa..c187b16 100644 --- a/src/markup/engine/__tests__/remarkup/link-with-punctuation.txt +++ b/src/markup/engine/__tests__/remarkup/link-with-punctuation.txt @@ -1,9 +1,9 @@ http://www.example.com/, http://www.example.com/.. http://www.example.com/!!! ~~~~~~~~~~ -

http://www.example.com/, -http://www.example.com/.. -http://www.example.com/!!!

+

http://www.example.com/, +http://www.example.com/.. +http://www.example.com/!!!

~~~~~~~~~~ http://www.example.com/, http://www.example.com/.. http://www.example.com/!!! diff --git a/src/markup/engine/__tests__/remarkup/link-with-tilde.txt b/src/markup/engine/__tests__/remarkup/link-with-tilde.txt index 5b22225..9f48f60 100644 --- a/src/markup/engine/__tests__/remarkup/link-with-tilde.txt +++ b/src/markup/engine/__tests__/remarkup/link-with-tilde.txt @@ -1,5 +1,5 @@ http://www.example.com/~ ~~~~~~~~~~ -

http://www.example.com/~

+

http://www.example.com/~

~~~~~~~~~~ http://www.example.com/~ diff --git a/src/markup/engine/__tests__/remarkup/link.txt b/src/markup/engine/__tests__/remarkup/link.txt index 112e7c0..903ab48 100644 --- a/src/markup/engine/__tests__/remarkup/link.txt +++ b/src/markup/engine/__tests__/remarkup/link.txt @@ -1,5 +1,5 @@ http://www.example.com/ ~~~~~~~~~~ -

http://www.example.com/

+

http://www.example.com/

~~~~~~~~~~ http://www.example.com/ diff --git a/src/markup/engine/__tests__/remarkup/list-alternate-style.txt b/src/markup/engine/__tests__/remarkup/list-alternate-style.txt index e92272b..420cd89 100644 --- a/src/markup/engine/__tests__/remarkup/list-alternate-style.txt +++ b/src/markup/engine/__tests__/remarkup/list-alternate-style.txt @@ -1,15 +1,15 @@ - a -- b --- c ~~~~~~~~~~ -
    -
  • a
      -
    • b
        -
      • c
      • +
          +
        • a
            +
          • b
              +
            • c
        ~~~~~~~~~~ - a - b - c diff --git a/src/markup/engine/__tests__/remarkup/list-blow-stack.txt b/src/markup/engine/__tests__/remarkup/list-blow-stack.txt index 24e1732..c5b1631 100644 --- a/src/markup/engine/__tests__/remarkup/list-blow-stack.txt +++ b/src/markup/engine/__tests__/remarkup/list-blow-stack.txt @@ -1,138 +1,138 @@ - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a derp ~~~~~~~~~~ -
          -
        • a
            -
          • a
              -
            • a
                -
              • a
                  -
                • a
                    -
                  • a
                      -
                    • a
                        -
                      • a
                          -
                        • a
                            -
                          • a
                              -
                            • a
                                -
                              • a
                                  -
                                • a
                                    -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • -
                                  • a
                                  • +
                                      +
                                    • a
                                        +
                                      • a
                                          +
                                        • a
                                            +
                                          • a
                                              +
                                            • a
                                                +
                                              • a
                                                  +
                                                • a
                                                    +
                                                  • a
                                                      +
                                                    • a
                                                        +
                                                      • a
                                                          +
                                                        • a
                                                            +
                                                          • a
                                                              +
                                                            • a
                                                                +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a
                                                              • +
                                                              • a

                                    derp

                                    ~~~~~~~~~~ - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a - a derp diff --git a/src/markup/engine/__tests__/remarkup/list-checkboxes.txt b/src/markup/engine/__tests__/remarkup/list-checkboxes.txt index 02b29fa..c48cbf6 100644 --- a/src/markup/engine/__tests__/remarkup/list-checkboxes.txt +++ b/src/markup/engine/__tests__/remarkup/list-checkboxes.txt @@ -1,35 +1,35 @@ - [] a - [ ] b - [X] c - d [ ] A [X] B [ ] C [ ] D ~~~~~~~~~~ -
                                      -
                                    • a
                                    • -
                                    • b
                                    • -
                                    • c
                                    • -
                                    • d
                                    • +
                                        +
                                      • a
                                      • +
                                      • b
                                      • +
                                      • c
                                      • +
                                      • d
                                      -
                                        -
                                      • A
                                      • -
                                      • B
                                          -
                                        • C
                                        • -
                                        • D
                                        • +
                                            +
                                          • A
                                          • +
                                          • B
                                              +
                                            • C
                                            • +
                                            • D
                                          ~~~~~~~~~~ [ ] a [ ] b [X] c - d [ ] A [X] B [ ] C [ ] D diff --git a/src/markup/engine/__tests__/remarkup/list-first-style-wins.txt b/src/markup/engine/__tests__/remarkup/list-first-style-wins.txt index be1050f..55bd4c5 100644 --- a/src/markup/engine/__tests__/remarkup/list-first-style-wins.txt +++ b/src/markup/engine/__tests__/remarkup/list-first-style-wins.txt @@ -1,19 +1,19 @@ # item - item - item derp ~~~~~~~~~~ -
                                            -
                                          1. item
                                          2. -
                                          3. item
                                          4. -
                                          5. item
                                          6. +
                                              +
                                            1. item
                                            2. +
                                            3. item
                                            4. +
                                            5. item

                                            derp

                                            ~~~~~~~~~~ 1. item 2. item 3. item derp diff --git a/src/markup/engine/__tests__/remarkup/list-hash.txt b/src/markup/engine/__tests__/remarkup/list-hash.txt index 92de420..d132309 100644 --- a/src/markup/engine/__tests__/remarkup/list-hash.txt +++ b/src/markup/engine/__tests__/remarkup/list-hash.txt @@ -1,19 +1,19 @@ # item # item # item derp ~~~~~~~~~~ -
                                              -
                                            1. item
                                            2. -
                                            3. item
                                            4. -
                                            5. item
                                            6. +
                                                +
                                              1. item
                                              2. +
                                              3. item
                                              4. +
                                              5. item

                                              derp

                                              ~~~~~~~~~~ 1. item 2. item 3. item derp diff --git a/src/markup/engine/__tests__/remarkup/list-mixed-styles.txt b/src/markup/engine/__tests__/remarkup/list-mixed-styles.txt index 0164f18..dcd6732 100644 --- a/src/markup/engine/__tests__/remarkup/list-mixed-styles.txt +++ b/src/markup/engine/__tests__/remarkup/list-mixed-styles.txt @@ -1,15 +1,15 @@ - a -- b --- c ~~~~~~~~~~ -
                                                -
                                              • a
                                                  -
                                                • b
                                                    -
                                                  • c
                                                  • +
                                                      +
                                                    • a
                                                        +
                                                      • b
                                                          +
                                                        • c
                                                    ~~~~~~~~~~ - a - b - c diff --git a/src/markup/engine/__tests__/remarkup/list-multi.txt b/src/markup/engine/__tests__/remarkup/list-multi.txt index 8227664..ee7b307 100644 --- a/src/markup/engine/__tests__/remarkup/list-multi.txt +++ b/src/markup/engine/__tests__/remarkup/list-multi.txt @@ -1,14 +1,14 @@ - a -- b -- c ~~~~~~~~~~ -
                                                      -
                                                    • a
                                                        -
                                                      • b
                                                      • -
                                                      • c
                                                      • +
                                                          +
                                                        • a
                                                            +
                                                          • b
                                                          • +
                                                          • c
                                                        ~~~~~~~~~~ - a - b - c diff --git a/src/markup/engine/__tests__/remarkup/list-multiline.txt b/src/markup/engine/__tests__/remarkup/list-multiline.txt index 4942765..362133a 100644 --- a/src/markup/engine/__tests__/remarkup/list-multiline.txt +++ b/src/markup/engine/__tests__/remarkup/list-multiline.txt @@ -1,16 +1,16 @@ - a a - b b ~~~~~~~~~~ -
                                                          -
                                                        • a a
                                                        • -
                                                        • b
                                                        • +
                                                            +
                                                          • a a
                                                          • +
                                                          • b

                                                          b

                                                          ~~~~~~~~~~ - a a - b b diff --git a/src/markup/engine/__tests__/remarkup/list-nest.txt b/src/markup/engine/__tests__/remarkup/list-nest.txt index adcbf8a..9ce4719 100644 --- a/src/markup/engine/__tests__/remarkup/list-nest.txt +++ b/src/markup/engine/__tests__/remarkup/list-nest.txt @@ -1,30 +1,30 @@ - item - sub - item # sub # sub - item derp ~~~~~~~~~~ -
                                                            -
                                                          • item
                                                              -
                                                            • sub
                                                            • +
                                                                +
                                                              • item
                                                                  +
                                                                • sub
                                                              • -
                                                              • item
                                                                  -
                                                                1. sub
                                                                2. -
                                                                3. sub
                                                                4. +
                                                                5. item
                                                                    +
                                                                  1. sub
                                                                  2. +
                                                                  3. sub
                                                                6. -
                                                                7. item
                                                                8. +
                                                                9. item

                                                              derp

                                                              ~~~~~~~~~~ - item - sub - item 1. sub 2. sub - item derp diff --git a/src/markup/engine/__tests__/remarkup/list-staircase.txt b/src/markup/engine/__tests__/remarkup/list-staircase.txt index 7253136..841122c 100644 --- a/src/markup/engine/__tests__/remarkup/list-staircase.txt +++ b/src/markup/engine/__tests__/remarkup/list-staircase.txt @@ -1,25 +1,25 @@ - top - mid # bot derp ~~~~~~~~~~ -
                                                                -
                                                                • -
                                                                  • -
                                                                  • top
                                                                  • +
                                                                      +
                                                                      • +
                                                                        • +
                                                                        • top
                                                                      • -
                                                                      • mid
                                                                      • +
                                                                      • mid
                                                                    1. -
                                                                    2. bot
                                                                    3. +
                                                                    4. bot

                                                                    derp

                                                                    ~~~~~~~~~~ 1. - - top - mid 2. bot derp diff --git a/src/markup/engine/__tests__/remarkup/list-star.txt b/src/markup/engine/__tests__/remarkup/list-star.txt index af0b430..f86e489 100644 --- a/src/markup/engine/__tests__/remarkup/list-star.txt +++ b/src/markup/engine/__tests__/remarkup/list-star.txt @@ -1,19 +1,19 @@ * item * item * item derp ~~~~~~~~~~ -
                                                                      -
                                                                    • item
                                                                    • -
                                                                    • item
                                                                    • -
                                                                    • item
                                                                    • +
                                                                        +
                                                                      • item
                                                                      • +
                                                                      • item
                                                                      • +
                                                                      • item

                                                                      derp

                                                                      ~~~~~~~~~~ - item - item - item derp diff --git a/src/markup/engine/__tests__/remarkup/list-then-a-list.txt b/src/markup/engine/__tests__/remarkup/list-then-a-list.txt index 1e8ac6f..f774f54 100644 --- a/src/markup/engine/__tests__/remarkup/list-then-a-list.txt +++ b/src/markup/engine/__tests__/remarkup/list-then-a-list.txt @@ -1,15 +1,15 @@ # one - a ~~~~~~~~~~ -
                                                                        -
                                                                      1. one
                                                                      2. +
                                                                          +
                                                                        1. one
                                                                        -
                                                                          -
                                                                        • a
                                                                        • +
                                                                            +
                                                                          • a
                                                                          ~~~~~~~~~~ 1. one - a diff --git a/src/markup/engine/__tests__/remarkup/list-vs-codeblock.txt b/src/markup/engine/__tests__/remarkup/list-vs-codeblock.txt index 5d9f37c..1b51134 100644 --- a/src/markup/engine/__tests__/remarkup/list-vs-codeblock.txt +++ b/src/markup/engine/__tests__/remarkup/list-vs-codeblock.txt @@ -1,17 +1,17 @@ This should be a list: - apple - banana ~~~~~~~~~~

                                                                          This should be a list:

                                                                          -
                                                                            -
                                                                          • apple
                                                                          • -
                                                                          • banana
                                                                          • +
                                                                              +
                                                                            • apple
                                                                            • +
                                                                            • banana
                                                                            ~~~~~~~~~~ This should be a list: - apple - banana diff --git a/src/markup/engine/__tests__/remarkup/list.txt b/src/markup/engine/__tests__/remarkup/list.txt index 8f22b84..eda8781 100644 --- a/src/markup/engine/__tests__/remarkup/list.txt +++ b/src/markup/engine/__tests__/remarkup/list.txt @@ -1,13 +1,13 @@ - < > & " text block ~~~~~~~~~~ -
                                                                              -
                                                                            • < > & "
                                                                            • +
                                                                                +
                                                                              • < > & "

                                                                              text block

                                                                              ~~~~~~~~~~ - < > & " text block diff --git a/src/markup/engine/__tests__/remarkup/monospaced-in-monospaced.txt b/src/markup/engine/__tests__/remarkup/monospaced-in-monospaced.txt index 45ae1dd..c081b52 100644 --- a/src/markup/engine/__tests__/remarkup/monospaced-in-monospaced.txt +++ b/src/markup/engine/__tests__/remarkup/monospaced-in-monospaced.txt @@ -1,18 +1,18 @@ ##SELECT * FROM `table`## `SELECT * FROM ##table##` `**x**` ~~~~~~~~~~ -

                                                                              SELECT * FROM `table`

                                                                              +

                                                                              SELECT * FROM `table`

                                                                              -

                                                                              SELECT * FROM ##table##

                                                                              +

                                                                              SELECT * FROM ##table##

                                                                              -

                                                                              **x**

                                                                              +

                                                                              **x**

                                                                              ~~~~~~~~~~ ##SELECT * FROM `table`## `SELECT * FROM ##table##` `**x**` diff --git a/src/markup/engine/__tests__/remarkup/monospaced-plural.txt b/src/markup/engine/__tests__/remarkup/monospaced-plural.txt index 4cb4124..cb78ae9 100644 --- a/src/markup/engine/__tests__/remarkup/monospaced-plural.txt +++ b/src/markup/engine/__tests__/remarkup/monospaced-plural.txt @@ -1,11 +1,11 @@ `Zebra`s I can`t and I won`t. ~~~~~~~~~~ -

                                                                              Zebras

                                                                              +

                                                                              Zebras

                                                                              I can`t and I won`t.

                                                                              ~~~~~~~~~~ `Zebra`s I can`t and I won`t. diff --git a/src/markup/engine/__tests__/remarkup/monospaced.txt b/src/markup/engine/__tests__/remarkup/monospaced.txt index 94b809d..4ddc9ae 100644 --- a/src/markup/engine/__tests__/remarkup/monospaced.txt +++ b/src/markup/engine/__tests__/remarkup/monospaced.txt @@ -1,5 +1,5 @@ ##ls --color > /dev/null## ~~~~~~~~~~ -

                                                                              ls --color > /dev/null

                                                                              +

                                                                              ls --color > /dev/null

                                                                              ~~~~~~~~~~ ##ls --color > /dev/null## diff --git a/src/markup/engine/__tests__/remarkup/ordered-list-with-numbers.txt b/src/markup/engine/__tests__/remarkup/ordered-list-with-numbers.txt index c00cd66..601feca 100644 --- a/src/markup/engine/__tests__/remarkup/ordered-list-with-numbers.txt +++ b/src/markup/engine/__tests__/remarkup/ordered-list-with-numbers.txt @@ -1,48 +1,48 @@ # aasdx # asdf 1. asa # asdf 234) asdf 234) asd 1. asd 234) asd 1/ This explicitly should not be formatted as a list. ~~~~~~~~~~ -
                                                                                -
                                                                              1. aasdx
                                                                              2. -
                                                                              3. asdf
                                                                              4. +
                                                                                  +
                                                                                1. aasdx
                                                                                2. +
                                                                                3. asdf
                                                                                -
                                                                                  -
                                                                                1. asa
                                                                                    -
                                                                                  1. asdf
                                                                                  2. +
                                                                                      +
                                                                                    1. asa
                                                                                        +
                                                                                      1. asdf
                                                                                    2. -
                                                                                    3. asdf
                                                                                    4. +
                                                                                    5. asdf

                                                                                    234) asd

                                                                                    -
                                                                                      -
                                                                                    1. asd
                                                                                    2. -
                                                                                    3. asd
                                                                                    4. +
                                                                                        +
                                                                                      1. asd
                                                                                      2. +
                                                                                      3. asd

                                                                                      1/ This explicitly should not be formatted as a list.

                                                                                      ~~~~~~~~~~ 1. aasdx 2. asdf 1. asa 1. asdf 2. asdf 234) asd 1. asd 2. asd 1/ This explicitly should not be formatted as a list. diff --git a/src/markup/engine/__tests__/remarkup/percent-block-multiline.txt b/src/markup/engine/__tests__/remarkup/percent-block-multiline.txt index f19ad47..889bb55 100644 --- a/src/markup/engine/__tests__/remarkup/percent-block-multiline.txt +++ b/src/markup/engine/__tests__/remarkup/percent-block-multiline.txt @@ -1,21 +1,21 @@ **foo** %%%- first - second - third%%% [[http://hello | world]] ~~~~~~~~~~

                                                                                      foo

                                                                                      - first
                                                                                      - second
                                                                                      - third -

                                                                                      world

                                                                                      +

                                                                                      world

                                                                                      ~~~~~~~~~~ **foo** - first - second - third world diff --git a/src/markup/engine/__tests__/remarkup/reply-nested.txt b/src/markup/engine/__tests__/remarkup/reply-nested.txt index 1c0e34e..f77ceac 100644 --- a/src/markup/engine/__tests__/remarkup/reply-nested.txt +++ b/src/markup/engine/__tests__/remarkup/reply-nested.txt @@ -1,50 +1,50 @@ >>! Previously, fruit: > > - Apple > - Banana > - Cherry > >>>! More previously, vegetables: >> >> - Potato >> - Potato >> - Potato > > The end. ~~~~~~~~~~
                                                                                      Previously, fruit:
                                                                                      -
                                                                                        -
                                                                                      • Apple
                                                                                      • -
                                                                                      • Banana
                                                                                      • -
                                                                                      • Cherry
                                                                                      • +
                                                                                          +
                                                                                        • Apple
                                                                                        • +
                                                                                        • Banana
                                                                                        • +
                                                                                        • Cherry
                                                                                        More previously, vegetables:
                                                                                        -
                                                                                          -
                                                                                        • Potato
                                                                                        • -
                                                                                        • Potato
                                                                                        • -
                                                                                        • Potato
                                                                                        • +
                                                                                            +
                                                                                          • Potato
                                                                                          • +
                                                                                          • Potato
                                                                                          • +
                                                                                          • Potato

                                                                                        The end.

                                                                                      ~~~~~~~~~~ Previously, fruit: > - Apple > - Banana > - Cherry > > More previously, vegetables: > > > - Potato > > - Potato > > - Potato > > > The end. diff --git a/src/markup/engine/__tests__/remarkup/simple-table-with-link.txt b/src/markup/engine/__tests__/remarkup/simple-table-with-link.txt index 35df4d5..da07098 100644 --- a/src/markup/engine/__tests__/remarkup/simple-table-with-link.txt +++ b/src/markup/engine/__tests__/remarkup/simple-table-with-link.txt @@ -1,7 +1,7 @@ | [[ http://example.com | name ]] | [x] | ~~~~~~~~~~ - +
                                                                                      name[x]
                                                                                      name[x]
                                                                                      ~~~~~~~~~~ | name | [x] | diff --git a/src/markup/engine/__tests__/remarkup/table.txt b/src/markup/engine/__tests__/remarkup/table.txt index 091f548..33a462d 100644 --- a/src/markup/engine/__tests__/remarkup/table.txt +++ b/src/markup/engine/__tests__/remarkup/table.txt @@ -1,16 +1,16 @@
                                                                                      TableStorage
                                                                                      `differential_diff`InnoDB
                                                                                      `edge`?
                                                                                      ~~~~~~~~~~ - - + +
                                                                                      TableStorage
                                                                                      differential_diffInnoDB
                                                                                      edge?
                                                                                      differential_diffInnoDB
                                                                                      edge?
                                                                                      ~~~~~~~~~~ | Table | Storage | | ------------------- | ------- | | `differential_diff` | InnoDB | | `edge` | ? | diff --git a/src/markup/engine/__tests__/remarkup/toc.txt b/src/markup/engine/__tests__/remarkup/toc.txt index a4d7de6..43448f7 100644 --- a/src/markup/engine/__tests__/remarkup/toc.txt +++ b/src/markup/engine/__tests__/remarkup/toc.txt @@ -1,29 +1,29 @@ = [[ http://www.example.com/ | link_name ]] = == **bold** == = http://www.example.com = ~~~~~~~~~~ -

                                                                                      link_name

                                                                                      +

                                                                                      link_name

                                                                                      -

                                                                                      bold

                                                                                      +

                                                                                      bold

                                                                                      -

                                                                                      http://www.example.com

                                                                                      +

                                                                                      http://www.example.com

                                                                                      ~~~~~~~~~~ [[ http://www.example.com/ | link_name ]] ========================================= **bold** -------- http://www.example.com ====================== diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHeaderBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHeaderBlockRule.php index b9b09a1..fdfc34f 100644 --- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHeaderBlockRule.php +++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHeaderBlockRule.php @@ -1,164 +1,166 @@ 1) { $level = ($lines[1][0] == '=') ? 1 : 2; $text = trim($lines[0]); } else { $level = 0; for ($ii = 0; $ii < min(5, strlen($text)); $ii++) { if ($text[$ii] == '=') { ++$level; } else { break; } } $text = trim($text, ' ='); } $engine = $this->getEngine(); if ($engine->isTextMode()) { $char = ($level == 1) ? '=' : '-'; return $text."\n".str_repeat($char, phutil_utf8_strlen($text)); } $use_anchors = $engine->getConfig('header.generate-toc'); $anchor = null; if ($use_anchors) { $anchor = $this->generateAnchor($level, $text); } $text = phutil_tag( 'h'.($level + 1), - array(), + array( + 'class' => 'remarkup-header', + ), array($anchor, $this->applyRules($text))); return $text; } private function generateAnchor($level, $text) { $anchor = strtolower($text); $anchor = preg_replace('/[^a-z0-9]/', '-', $anchor); $anchor = preg_replace('/--+/', '-', $anchor); $anchor = trim($anchor, '-'); $anchor = substr($anchor, 0, 24); $anchor = trim($anchor, '-'); $base = $anchor; $key = self::KEY_HEADER_TOC; $engine = $this->getEngine(); $anchors = $engine->getTextMetadata($key, array()); $suffix = 1; while (!strlen($anchor) || isset($anchors[$anchor])) { $anchor = $base.'-'.$suffix; $anchor = trim($anchor, '-'); $suffix++; } // When a document contains a link inside a header, like this: // // = [[ http://wwww.example.com/ | example ]] = // // ...we want to generate a TOC entry with just "example", but link the // header itself. We push the 'toc' state so all the link rules generate // just names. $engine->pushState('toc'); $text = $this->applyRules($text); $text = $engine->restoreText($text); $anchors[$anchor] = array($level, $text); $engine->popState('toc'); $engine->setTextMetadata($key, $anchors); return phutil_tag( 'a', array( 'name' => $anchor, ), ''); } public static function renderTableOfContents(PhutilRemarkupEngine $engine) { $key = self::KEY_HEADER_TOC; $anchors = $engine->getTextMetadata($key, array()); if (count($anchors) < 2) { // Don't generate a TOC if there are no headers, or if there's only // one header (since such a TOC would be silly). return null; } $depth = 0; $toc = array(); foreach ($anchors as $anchor => $info) { list($level, $name) = $info; while ($depth < $level) { $toc[] = hsprintf('
                                                                                        '); $depth++; } while ($depth > $level) { $toc[] = hsprintf('
                                                                                      '); $depth--; } $toc[] = phutil_tag( 'li', array(), phutil_tag( 'a', array( 'href' => '#'.$anchor, ), $name)); } while ($depth > 0) { $toc[] = hsprintf('
                                                                            '); $depth--; } return phutil_implode_html("\n", $toc); } } diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHorizontalRuleBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHorizontalRuleBlockRule.php index fa447c7..7343339 100644 --- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHorizontalRuleBlockRule.php +++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupHorizontalRuleBlockRule.php @@ -1,37 +1,37 @@ 'remarkup-hr')); } } diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupListBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupListBlockRule.php index 741d5bc..ad2cc90 100644 --- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupListBlockRule.php +++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupListBlockRule.php @@ -1,479 +1,485 @@ $line) { $matches = null; if (preg_match($regex, $line)) { $regex = self::CONT_BLOCK_PATTERN; if (preg_match('/^(\s+)/', $line, $matches)) { $space = strlen($matches[1]); } else { $space = 0; } $min_space = min($min_space, $space); } } $regex = self::START_BLOCK_PATTERN; if ($min_space) { foreach ($lines as $key => $line) { if (preg_match($regex, $line)) { $regex = self::CONT_BLOCK_PATTERN; $lines[$key] = substr($line, $min_space); } } } // The input text may have linewraps in it, like this: // // - derp derp derp derp // derp derp derp derp // - blarp blarp blarp blarp // // Group text lines together into list items, stored in $items. So the // result in the above case will be: // // array( // array( // "- derp derp derp derp", // " derp derp derp derp", // ), // array( // "- blarp blarp blarp blarp", // ), // ); $item = array(); $regex = self::START_BLOCK_PATTERN; foreach ($lines as $line) { if (preg_match($regex, $line)) { $regex = self::CONT_BLOCK_PATTERN; if ($item) { $items[] = $item; $item = array(); } } $item[] = $line; } if ($item) { $items[] = $item; } // Process each item to normalize the text, remove line wrapping, and // determine its depth (indentation level) and style (ordered vs unordered). // // Given the above example, the processed array will look like: // // array( // array( // 'text' => 'derp derp derp derp derp derp derp derp', // 'depth' => 0, // 'style' => '-', // ), // array( // 'text' => 'blarp blarp blarp blarp', // 'depth' => 0, // 'style' => '-', // ), // ); $has_marks = false; foreach ($items as $key => $item) { $item = preg_replace('/\s*\n\s*/', ' ', implode("\n", $item)); $item = rtrim($item); if (!strlen($item)) { unset($items[$key]); continue; } $matches = null; if (preg_match('/^\s*([-*#]{2,})/', $item, $matches)) { // Alternate-style indents; use number of list item symbols. $depth = strlen($matches[1]) - 1; } else if (preg_match('/^(\s+)/', $item, $matches)) { // Markdown-style indents; use indent depth. $depth = strlen($matches[1]); } else { $depth = 0; } if (preg_match('/^\s*(?:#|[0-9])/', $item)) { $style = '#'; } else { $style = '-'; } // Strip leading indicators off the item. $text = preg_replace(self::STRIP_BLOCK_PATTERN, '', $item); // Look for "[]", "[ ]", "[*]", "[x]", etc., which we render as a // checkbox. $mark = null; $matches = null; if (preg_match('/^\s*\[(.?)\]\s*/', $text, $matches)) { if (strlen(trim($matches[1]))) { $mark = true; } else { $mark = false; } $has_marks = true; $text = substr($text, strlen($matches[0])); } $items[$key] = array( 'text' => $text, 'depth' => $depth, 'style' => $style, 'mark' => $mark, ); } $items = array_values($items); // Users can create a sub-list by indenting any deeper amount than the // previous list, so these are both valid: // // - a // - b // // - a // - b // // In the former case, we'll have depths (0, 2). In the latter case, depths // (0, 4). We don't actually care about how many spaces there are, only // how many list indentation levels (that is, we want to map both of // those cases to (0, 1), indicating "outermost list" and "first sublist"). // // This is made more complicated because lists at two different indentation // levels might be at the same list level: // // - a // - b // - c // - d // // Here, 'b' and 'd' are at the same list level (2) but different indent // levels (2, 4). // // Users can also create "staircases" like this: // // - a // - b // # c // // While this is silly, we'd like to render it as faithfully as possible. // // In order to do this, we convert the list of nodes into a tree, // normalizing indentation levels and inserting dummy nodes as necessary to // make the tree well-formed. See additional notes at buildTree(). // // In the case above, the result is a tree like this: // // - // - // - a // - b // # c $l = 0; $r = count($items); $tree = $this->buildTree($items, $l, $r, $cur_level = 0); // We may need to open a list on a node, but they do not have // list style information yet. We need to propagate list style inforamtion // backward through the tree. In the above example, the tree now looks // like this: // // - // - // - a // - b // # c $this->adjustTreeStyleInformation($tree); // Finally, we have enough information to render the tree. $out = $this->renderTree($tree, 0, $has_marks); if ($this->getEngine()->isTextMode()) { $out = implode('', $out); $out = rtrim($out, "\n"); $out = preg_replace('/ +$/m', '', $out); return $out; } return phutil_implode_html('', $out); } /** * See additional notes in markupText(). */ private function buildTree(array $items, $l, $r, $cur_level) { if ($l == $r) { return array(); } if ($cur_level > self::MAXIMUM_LIST_NESTING_DEPTH) { // This algorithm is recursive and we don't need you blowing the stack // with your oh-so-clever 50,000-item-deep list. Cap indentation levels // at a reasonable number and just shove everything deeper up to this // level. $nodes = array(); for ($ii = $l; $ii < $r; $ii++) { $nodes[] = array( 'level' => $cur_level, 'items' => array(), ) + $items[$ii]; } return $nodes; } $min = $l; for ($ii = $r - 1; $ii >= $l; $ii--) { if ($items[$ii]['depth'] < $items[$min]['depth']) { $min = $ii; } } $min_depth = $items[$min]['depth']; $nodes = array(); if ($min != $l) { $nodes[] = array( 'text' => null, 'level' => $cur_level, 'style' => null, 'mark' => null, 'items' => $this->buildTree($items, $l, $min, $cur_level + 1), ); } $last = $min; for ($ii = $last + 1; $ii < $r; $ii++) { if ($items[$ii]['depth'] == $min_depth) { $nodes[] = array( 'level' => $cur_level, 'items' => $this->buildTree($items, $last + 1, $ii, $cur_level + 1), ) + $items[$last]; $last = $ii; } } $nodes[] = array( 'level' => $cur_level, 'items' => $this->buildTree($items, $last + 1, $r, $cur_level + 1), ) + $items[$last]; return $nodes; } /** * See additional notes in markupText(). */ private function adjustTreeStyleInformation(array &$tree) { // The effect here is just to walk backward through the nodes at this level // and apply the first style in the list to any empty nodes we inserted // before it. As we go, also recurse down the tree. $style = '-'; for ($ii = count($tree) - 1; $ii >= 0; $ii--) { if ($tree[$ii]['style'] !== null) { // This is the earliest node we've seen with style, so set the // style to its style. $style = $tree[$ii]['style']; } else { // This node has no style, so apply the current style. $tree[$ii]['style'] = $style; } if ($tree[$ii]['items']) { $this->adjustTreeStyleInformation($tree[$ii]['items']); } } } /** * See additional notes in markupText(). */ private function renderTree(array $tree, $level, $has_marks) { $style = idx(head($tree), 'style'); $out = array(); if (!$this->getEngine()->isTextMode()) { switch ($style) { case '#': $tag = 'ol'; break; case '-': $tag = 'ul'; break; } if ($has_marks) { - $out[] = hsprintf('<%s class="remarkup-list-with-checkmarks">', $tag); + $out[] = hsprintf( + '<%s class="remarkup-list remarkup-list-with-checkmarks">', + $tag); } else { - $out[] = hsprintf('<%s>', $tag); + $out[] = hsprintf( + '<%s class="remarkup-list">', + $tag); } $out[] = "\n"; } $number = 1; foreach ($tree as $item) { if ($this->getEngine()->isTextMode()) { $out[] = str_repeat(' ', 2 * $level); if ($item['mark'] !== null) { if ($item['mark']) { $out[] = '[X] '; } else { $out[] = '[ ] '; } } else { switch ($style) { case '#': $out[] = $number.'. '; $number++; break; case '-': $out[] = '- '; break; } } $out[] = $this->applyRules($item['text'])."\n"; } else if ($item['text'] === null) { - $out[] = hsprintf('
                                                                          • '); + $out[] = hsprintf('
                                                                          • '); } else { if ($item['mark'] !== null) { if ($item['mark'] == true) { - $out[] = hsprintf('
                                                                          • '); + $out[] = hsprintf( + '
                                                                          • '); } else { - $out[] = hsprintf('
                                                                          • '); + $out[] = hsprintf( + '
                                                                          • '); } $out[] = phutil_tag( 'input', array( 'type' => 'checkbox', 'checked' => ($item['mark'] ? 'checked' : null), 'disabled' => 'disabled', )); $out[] = ' '; } else { - $out[] = hsprintf('
                                                                          • '); + $out[] = hsprintf('
                                                                          • '); } $out[] = $this->applyRules($item['text']); } if ($item['items']) { $subitems = $this->renderTree($item['items'], $level + 1, $has_marks); foreach ($subitems as $i) { $out[] = $i; } } if (!$this->getEngine()->isTextMode()) { $out[] = hsprintf("
                                                                          • \n"); } } if (!$this->getEngine()->isTextMode()) { switch ($style) { case '#': $out[] = hsprintf('
                                                                      '); break; case '-': $out[] = hsprintf('
                                                                    '); break; } } return $out; } } diff --git a/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleDocumentLink.php b/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleDocumentLink.php index ee33577..7ff0f23 100644 --- a/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleDocumentLink.php +++ b/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleDocumentLink.php @@ -1,126 +1,127 @@ getEngine()->isTextMode()) { $text = $link; if (strncmp($link, '/', 1) == 0 || strncmp($link, '#', 1) == 0) { $base = $this->getEngine()->getConfig('uri.prefix'); if (strncmp($link, '/', 1) == 0) { $base = rtrim($base, '/'); } $text = $base.$text; } // If present, strip off "mailto:". $text = preg_replace('/^mailto:/', '', $text); if ($link == $name) { return $text; } return $name.' <'.$text.'>'; } // By default, we open links in a new window or tab. For anchors on the same // page, just jump normally. $target = '_blank'; if (strncmp($link, '#', 1) == 0) { $target = null; } $name = preg_replace('/^mailto:/', '', $name); if ($this->getEngine()->getState('toc')) { return $name; } else { return phutil_tag( 'a', array( 'href' => $link, + 'class' => 'remarkup-link', 'target' => $target, ), $name); } } public function markupAlternateLink($matches) { $uri = trim($matches[2]); // NOTE: We apply some special rules to avoid false positives here. The // major concern is that we do not want to convert `x[0][1](y)` in a // discussion about C source code into a link. To this end, we: // // - Don't match at word boundaries; // - require the URI to contain a "/" character or "@" character; and // - reject URIs which being with a quote character. if ($uri[0] == '"' || $uri[0] == "'" || $uri[0] == '`') { return $matches[0]; } if (strpos($uri, '/') === false && strpos($uri, '@') === false) { return $matches[0]; } return $this->markupDocumentLink( array( $matches[0], $matches[2], $matches[1], )); } public function markupDocumentLink($matches) { $uri = trim($matches[1]); $name = trim(idx($matches, 2, $uri)); // If whatever is being linked to begins with "/" or "#", or has "://", // or is "mailto:", treat it as a URI instead of a wiki page. $is_uri = preg_match('@(^/)|(://)|(^#)|(^mailto:)@', $uri); if ($is_uri && strncmp('/', $uri, 1) && strncmp('#', $uri, 1)) { $protocols = $this->getEngine()->getConfig( 'uri.allowed-protocols', array()); $protocol = id(new PhutilURI($uri))->getProtocol(); if (!idx($protocols, $protocol)) { // Don't treat this as a URI if it's not an allowed protocol. $is_uri = false; } } if (!$is_uri) { return $matches[0]; } return $this->getEngine()->storeText($this->renderHyperlink($uri, $name)); } } diff --git a/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleHyperlink.php b/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleHyperlink.php index 5f2b956..7eb1d06 100644 --- a/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleHyperlink.php +++ b/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleHyperlink.php @@ -1,105 +1,106 @@ " around them get linked exactly, without // the "<>". Angle brackets are basically special and mean "this is a URL // with weird characters". This is assumed to be reasonable because they // don't appear in normal text or normal URLs. $text = preg_replace_callback( '@<(\w{3,}://[^\s'.PhutilRemarkupBlockStorage::MAGIC_BYTE.']+?)>@', array($this, 'markupHyperlink'), $text); // Anything else we match "ungreedily", which means we'll look for // stuff that's probably puncutation or otherwise not part of the URL and // not link it. This lets someone write "QuicK! Go to // http://www.example.com/!". We also apply some paren balancing rules. // NOTE: We're explicitly avoiding capturing stored blocks, so text like // `http://www.example.com/[[x | y]]` doesn't get aggressively captured. $text = preg_replace_callback( '@(\w{3,}://[^\s'.PhutilRemarkupBlockStorage::MAGIC_BYTE.']+)@', array($this, 'markupHyperlinkUngreedy'), $text); return $text; } protected function markupHyperlink($matches) { $protocols = $this->getEngine()->getConfig( 'uri.allowed-protocols', array()); $protocol = id(new PhutilURI($matches[1]))->getProtocol(); if (!idx($protocols, $protocol)) { // If this URI doesn't use a whitelisted protocol, don't link it. This // is primarily intended to prevent javascript:// silliness. return $this->getEngine()->storeText($matches[1]); } return $this->storeRenderedHyperlink($matches[1]); } protected function storeRenderedHyperlink($link) { return $this->getEngine()->storeText($this->renderHyperlink($link)); } protected function renderHyperlink($link) { if ($this->getEngine()->isTextMode()) { return $link; } if ($this->getEngine()->getState('toc')) { return $link; } else { return phutil_tag( 'a', array( 'href' => $link, + 'class' => 'remarkup-link', 'target' => '_blank', ), $link); } } protected function markupHyperlinkUngreedy($matches) { $match = $matches[1]; $tail = null; $trailing = null; if (preg_match('/[;,.:!?]+$/', $match, $trailing)) { $tail = $trailing[0]; $match = substr($match, 0, -strlen($tail)); } // If there's a closing paren at the end but no balancing open paren in // the URL, don't link the close paren. This is an attempt to gracefully // handle the two common paren cases, Wikipedia links and English language // parentheticals, e.g.: // // http://en.wikipedia.org/wiki/Noun_(disambiguation) // (see also http://www.example.com) // // We could apply a craftier heuristic here which tries to actually balance // the parens, but this is probably sufficient. if (preg_match('/\\)$/', $match) && !preg_match('/\\(/', $match)) { $tail = ')'.$tail; $match = substr($match, 0, -1); } return hsprintf('%s%s', $this->markupHyperlink(array(null, $match)), $tail); } } diff --git a/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleMonospace.php b/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleMonospace.php index 9376f98..43ecfe6 100644 --- a/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleMonospace.php +++ b/src/markup/engine/remarkup/markuprule/PhutilRemarkupRuleMonospace.php @@ -1,38 +1,43 @@ getEngine()->isTextMode()) { $result = $matches[0]; } else { $match = isset($matches[2]) ? $matches[2] : $matches[1]; - $result = phutil_tag('tt', array(), $match); + $result = phutil_tag( + 'tt', + array( + 'class' => 'remarkup-monospaced', + ), + $match); } return $this->getEngine()->storeText($result); } }