tidy-markdown
tidy-markdown copied to clipboard
tags with additional attributes are converted to markdown
moved from https://github.com/slang800/atom-tidy-markdown/issues/44 by @superbest
I noticed that
<img>tags seem to be corrected too aggressively.I have several files where I include images with something like
<img src="my image.png" width=500>because the image itself is too large for a nice layout. Tidy Markdown converts these into. This strips thewidthinformation, and disrupts layout.Possible solutions (pick one:
- Leave HTML tags alone and don't tidy them at all.
- Don't tidy
<img>tags.- Check the tag and only tidy if there are no properties besides
src.- Make HTML tag tidying optional behavior.
I think that adding an option like --no-aggressive-html-conversion (or a better name if someone can come up with one) would be a good idea... That option would make sure that any HTML which cannot be fully represented by Markdown isn't converted.
However, I think that, by default, we should strip attributes like that... It's quite useful when taking a webpage and rewriting it in Markdown and usually attributes like width should be handled by CSS.
I just want to throw in I think the default should be the other way around. Your average user isn't expecting to encounter reduced markdown when they use the plugin but someone who's transforming pages from HTML to MD is likely to investigate further.
So was there any resolution on this, or is this still an issue that someone has yet to take on?