Option for disabling escaping HTML reserved characters #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I'd like to propose creating an option named
escape_html
that defaults totrue
, but can be turned off.Background: I'm adopting this library for Shell commands plugin for Obsidian. Obsidian.md is a knowdge base/note taking application, and my plugin provides an ability to execute shell commands via hotkeys within Obsidian. One feature is that output received from shell commands can be utilized in Obsidian, for example by inserting the output to a currently open note.
As Obsidian uses the Markdown format for notes, it can display HTML content really well, so I'd like to combine being able to convert ANSI code to HTML, and also retain any possible HTML that might be outputted by user-specified shell commands.
Thank you for considering this! 🙂 This is just a proposal, and I'm willing to make changes if needed.
P.S. There are four commits in this PR, but they can be squashed to one. I was first thinking about making the
href=""
attribute not to be affected by this option for hyperlinks (i.e. it would always escapehref`` value even if the option is
false). But I changed my mind, as I came to think about that
&should not be escaped in urls as they might be part of a query string. So now setting
escape_html` to false prevents all escaping. I'm not 100% sure about this decision, so please let me know if you have any opinions. 🙂