"""Test caret.""" from .. import util class TestCriticViewMode(util.MdCase): """Test view mode.""" extension = [ 'pymdownx.critic' ] extension_configs = { "pymdownx.critic": { "mode": 'view' } } def test_view(self): """Test view mode.""" self.check_markdown( R""" Here is some {--*incorrect*--} Markdown. I am adding this{++ here.++}. Here is some more {--text that I am removing--}text. And here is even more {++text that I am ++}adding.{~~ ~> ~~}Paragraph was deleted and replaced with some spaces.{~~ ~> ~~}Spaces were removed and a paragraph was added. And here is a comment on {==some ==text== ==}{>>This works quite well. I just wanted to comment on it.<<}. Substitutions {~~is~>are~~} great! General block handling. {-- * test * test * test * test * test --} {++ * test * test * test * test * test ++} """, # noqa: E501 """

Here is some incorrect Markdown. I am adding this here.. Here is some more text that I am removingtext. And here is even more text that I am adding.  Paragraph was deleted and replaced with some spaces.

 

Spaces were removed and a paragraph was added.

And here is a comment on some ==text== This works quite well. I just wanted to comment on it.. Substitutions isare great!

General block handling.

""", # noqa: E501 True ) class TestCriticAcceptMode(util.MdCase): """Test accept mode.""" extension = [ 'pymdownx.critic' ] extension_configs = { "pymdownx.critic": { "mode": 'accept' } } def test_accept(self): """Test accept mode.""" self.check_markdown( R""" Here is some {--*incorrect*--} Markdown. I am adding this{++ here.++}. Here is some more {--text that I am removing--}text. And here is even more {++text that I am ++}adding.{~~ ~> ~~}Paragraph was deleted and replaced with some spaces.{~~ ~> ~~}Spaces were removed and a paragraph was added. And here is a comment on {==some ==text== ==}{>>This works quite well. I just wanted to comment on it.<<}. Substitutions {~~is~>are~~} great! General block handling. {-- * test * test * test * test * test --} {++ * test * test * test * test * test ++} """, # noqa: E501 """

Here is some Markdown. I am adding this here.. Here is some more text. And here is even more text that I am adding. Paragraph was deleted and replaced with some spaces.

Spaces were removed and a paragraph was added.

And here is a comment on some ==text== . Substitutions are great!

General block handling.

""", # noqa: E501 True ) class TestCriticRejectMode(util.MdCase): """Test reject mode.""" extension = [ 'pymdownx.critic' ] extension_configs = { "pymdownx.critic": { "mode": 'reject' } } def test_reject(self): """Test reject mode.""" self.check_markdown( R""" Here is some {--*incorrect*--} Markdown. I am adding this{++ here.++}. Here is some more {--text that I am removing--}text. And here is even more {++text that I am ++}adding.{~~ ~> ~~}Paragraph was deleted and replaced with some spaces.{~~ ~> ~~}Spaces were removed and a paragraph was added. And here is a comment on {==some ==text== ==}{>>This works quite well. I just wanted to comment on it.<<}. Substitutions {~~is~>are~~} great! General block handling. {-- * test * test * test * test * test --} {++ * test * test * test * test * test ++} """, # noqa: E501 """

Here is some incorrect Markdown. I am adding this. Here is some more text that I am removingtext. And here is even more adding.

Paragraph was deleted and replaced with some spaces. Spaces were removed and a paragraph was added.

And here is a comment on some ==text== . Substitutions is great!

General block handling.

""", True ) class TestCriticEscapeAll(util.MdCase): """Test critic with escaping.""" extension = [ 'pymdownx.critic', 'pymdownx.escapeall' ] extension_configs = { "pymdownx.critic": { "mode": 'view' } } def test_escape(self): """Test with escapes.""" self.check_markdown( R""" We shouldn't escape STX and ETX characters: Don't escape crtiic placeholder: \{>>comment<<} """, """

We shouldn't escape STX and ETX characters:

Don't escape crtiic placeholder: comment

""", True )