houfu / redlines

Show the differences between two strings/text as a compact text, in markdown/HTML, in the terminal and more.
https://houfu.github.io/redlines/
MIT License
110 stars 6 forks source link

Implement "ghfm" markdown style #17

Closed houfu closed 1 year ago

houfu commented 1 year ago

In the readme under custom styling, users are warned:

Styling will not appear in markdown environments which disallow HTML. There is no consistent support for strikethroughs and colors in the markdown standard, and styling is largely accomplished through raw HTML. If you are using GitHub or Streamlit, you may not get the formatting you expect or see any change at all.

To get formatting working in Streamlit, you need to set the unsafe_allow_html argument in st.write or st.markdown to True.

The alternative is to do a "ghfm" output, something like this: "The quick brown fox ~~jumps over~~ _walks past_ the lazy dog."

Which renders like this: "The quick brown fox jumps over walks past the lazy dog."

To do this: