Skip to content

Commit

Permalink
refactor: fix weibo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Sep 16, 2024
1 parent e3dbb46 commit 6b8efe9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion md2zhihu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,7 @@ def __init__(self, conf: Config, md_text: str):

self.ast = parse_in_list_tables(self.ast)

# TODO: optional disable replacing ref
self.used_refs = replace_ref_with_def(self.ast, self.refs)

# extract already inlined math
Expand All @@ -1427,6 +1428,7 @@ def __init__(self, conf: Config, md_text: str):
join_math_block(self.ast)
self.ast = parse_math(self.ast)

# TODO: optional disable embed
self.parse_embed()

def parse_embed(self):
Expand All @@ -1435,7 +1437,6 @@ def parse_embed(self):
self.used_refs.update(used_refs)

def render(self):

mdr = MDRender(self.conf, features=self.conf.features)

root_node = {
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ python setup.py install
# PYTHONPATH="$(cd ..; pwd)" pytest -x -v
# PYTHONPATH="$(cd ..; pwd)" pytest -x -v -k test_simple
# PYTHONPATH="$(cd ..; pwd)" pytest -x -v --show-capture=all -k test_minimal_mistake
PYTHONPATH="$(cd ..; pwd)" pytest -x -v --show-capture=all -k test_github
PYTHONPATH="$(cd ..; pwd)" pytest -x -v --show-capture=all -k test_weibo
2 changes: 2 additions & 0 deletions test/data/weibo/want/simple.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ table in list:
Reference:

- slim : [https://github.com/openacid/slim](https://github.com/openacid/slim)

- slimarray : [https://github.com/openacid/slimarray](https://github.com/openacid/slimarray)


[slim]: https://github.com/openacid/slim "slim"
[slimarray]: https://github.com/openacid/slimarray "slimarray"

0 comments on commit 6b8efe9

Please sign in to comment.