else:
parser.set_defaults(css_file=None)
+ parser.add_argument(
+ "--related-to-html-only",
+ action="store_true",
+ help="Make related content be sibling to HTML parts only"
+ )
+
parser.add_argument(
"--only-build",
action="store_true",
extensions=None,
cssfile=None,
converter=convert_markdown_to_html,
+ related_to_html_only=True,
only_build=False,
tempdir=None,
debug_commands=False,
draft_f.read(),
draftpath,
cssfile=cssfile,
+ related_to_html_only=related_to_html_only,
tempdir=tempdir,
extensions=extensions,
)
cmd_f,
extensions=args.extensions,
cssfile=args.css_file,
+ related_to_html_only=args.related_to_html_only,
only_build=args.only_build,
tempdir=args.tempdir,
debug_commands=args.debug_commands,
return StringIO(text or const1)
def test_do_massage_basic(self, const1, string_io, capsys):
- def converter(drafttext, draftpath, cssfile, extensions, tempdir):
+ def converter(
+ drafttext,
+ draftpath,
+ cssfile,
+ related_to_html_only,
+ extensions,
+ tempdir,
+ ):
return Part("text", "plain", draftpath, orig=True)
do_massage(
def test_do_massage_fulltree(
self, string_io, const1, mime_tree_related_to_alternative, capsys
):
- def converter(drafttext, draftpath, cssfile, extensions, tempdir):
+ def converter(
+ drafttext,
+ draftpath,
+ cssfile,
+ related_to_html_only,
+ extensions,
+ tempdir,
+ ):
return mime_tree_related_to_alternative
do_massage(
captured = capsys.readouterr()
lines = captured.out.splitlines()[4:-2]
- print(lines)
assert "first-entry" in lines.pop()
assert "update-encoding" in lines.pop()
assert "Plain" in lines.pop()
def test_mime_tree_relative_within_alternative(
self, string_io, const1, capsys, mime_tree_related_to_html
):
- def converter(drafttext, draftpath, cssfile, extensions, tempdir):
+ def converter(
+ drafttext,
+ draftpath,
+ cssfile,
+ related_to_html_only,
+ extensions,
+ tempdir,
+ ):
return mime_tree_related_to_html
do_massage(