Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preformatting in code blocks results in visible tags #17

Closed
adam-p opened this issue Jun 26, 2012 · 1 comment
Closed

Preformatting in code blocks results in visible tags #17

adam-p opened this issue Jun 26, 2012 · 1 comment
Labels

Comments

@adam-p
Copy link
Owner

adam-p commented Jun 26, 2012

Any preformatting (using Gmail formatting buttons, for example) done in a code block will result in the formatting tags being visible after Markdown-Toggling. This is because the <pre> block doesn't render any internal tags.

Workaround: Don't put formatting in code blocks.

It would be nice to fix this, but I can't think of a clean approach yet. Some ideas:

  • Remove the keep-preformatting feature completely. It's a bit convenient, but it's mostly a crutch that maybe no one uses. If it's going to potentially cause problems, then maybe it's not worth it.
  • When escaping styling tags during the HTML-to-plaintext step, don't escape tags that are in code blocks. I think that this is easier said than done -- I'm not sure how to do it reliably.
  • Somehow tie the HTML-to-plaintext (jsHtmlToText) and plaintext-to-Markdown (marked) code closer together. We need to do the first step conversion before the second step, but we don't know what tags should and shouldn't be kept in the first step until we do the second step. So, do some tentative to-plaintexting, then do some from-plaintexting, and then maybe backup and change the to-plaintexting because it turned out it was being rendered to a <pre> block. Sounds horrible.
adam-p added a commit that referenced this issue Jun 27, 2012
… tags. Fixed by specifically excluding the Chrome-inserted tab spans.
@adam-p
Copy link
Owner Author

adam-p commented Jul 24, 2012

Fixed with the removal of pre-formatting retention (so, the first idea above) -- version 2.4.0. See rev eac45d1.

@adam-p adam-p closed this as completed Jul 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant