Skip to content

Commit

Permalink
pona: o pona e ilo Codeblocks
Browse files Browse the repository at this point in the history
lon la pakala li awen ken tan ni:
nasin pi ilo Siko li nasa *wawa*. taso, ken suli la toki pona li nasa
ala lon nasin ni la nasin ni mi li pona. kin la, nasin toki li nasa lon
toki wan la ona li musi ilo li toki pona ala anu seme...
  • Loading branch information
gregdan3 committed Aug 17, 2024
1 parent 56010d4 commit 4ba3aa7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sonatoki/Preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class Codeblock(RegexPreprocessor):
"""

pattern = re.compile(
r"^```(?:[\w\-]+)?$(?:(?!```).*?)^```$",
flags=re.MULTILINE | re.DOTALL,
r"```.+?```",
flags=re.DOTALL,
)


Expand Down
6 changes: 6 additions & 0 deletions tests/test_preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ def test_Backticks(s: str):
second blocky message
```"""
)
@example(
"""```oisandm123-_mu
arbitrary content
```"""
)
@example("""```mu```""")
def test_Codeblock(s: str):
res = Codeblock.process(s).strip()
assert res == "", (repr(s), repr(res))
Expand Down

0 comments on commit 4ba3aa7

Please sign in to comment.