Skip to content

Commit d73a195

Browse files
committed
fixes #151
1 parent c471de3 commit d73a195

2 files changed

Lines changed: 7 additions & 17 deletions

File tree

monsterui/franken.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,9 @@ def render_md(md_content:str, # Markdown content
15751575
"Renders markdown using mistletoe and lxml with custom image handling"
15761576
if md_content=='': return md_content
15771577
html_content = mistletoe.markdown(md_content, partial(renderer, img_dir=img_dir))
1578-
return NotStr(apply_classes(html_content, class_map, class_map_mods))
1578+
if (class_map or class_map is None) or class_map_mods:
1579+
html_content = apply_classes(html_content, class_map, class_map_mods)
1580+
return NotStr(html_content)
15791581

15801582
# %% ../nbs/02_franken.ipynb
15811583
def ThemePicker(color=True, radii=True, shadows=True, font=True, mode=True, cls='p-4', custom_themes=[]):

nbs/02_franken.ipynb

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,7 +3656,9 @@
36563656
" \"Renders markdown using mistletoe and lxml with custom image handling\"\n",
36573657
" if md_content=='': return md_content\n",
36583658
" html_content = mistletoe.markdown(md_content, partial(renderer, img_dir=img_dir))\n",
3659-
" return NotStr(apply_classes(html_content, class_map, class_map_mods))"
3659+
" if (class_map or class_map is None) or class_map_mods:\n",
3660+
" html_content = apply_classes(html_content, class_map, class_map_mods)\n",
3661+
" return NotStr(html_content)"
36603662
]
36613663
},
36623664
{
@@ -4622,23 +4624,9 @@
46224624
"from nbdev import nbdev_export\n",
46234625
"nbdev_export()"
46244626
]
4625-
},
4626-
{
4627-
"cell_type": "code",
4628-
"execution_count": null,
4629-
"id": "de35d138",
4630-
"metadata": {},
4631-
"outputs": [],
4632-
"source": []
46334627
}
46344628
],
4635-
"metadata": {
4636-
"kernelspec": {
4637-
"display_name": "python3",
4638-
"language": "python",
4639-
"name": "python3"
4640-
}
4641-
},
4629+
"metadata": {},
46424630
"nbformat": 4,
46434631
"nbformat_minor": 5
46444632
}

0 commit comments

Comments
 (0)