You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Digging into the gatsby-remark-prismjs code highlights that the most common HTML entities ( <, >, ", ```, etc) are escaped using the lodash.escape function. I have personally encountered the requirement to expand on the number of characters escaped to include curly braces (`{`).
Basic example
Allow another option in the plugin to allow for additional characters to be replaced by an encoded version.
Immediately I foresee two ways to accomplish this:
The plugin stores a dictionary of all HTML entities and their encoded versions and the plugin option allows the user to pass in a list of entities.
During the support of my application, I encountered a very hard to debug the issue. The static site Server I was using (Caddy Server) was evaluating ansible handle bar code examples{{ .. }} as valid Caddy template variables. This was causing my server to crash.
To me, the most sensible solution allows for additional HTML entities to be escaped.
I initially authored my own remark plugin to escape these entities...which did work but unfortunately, it is not compatible with the remark-prismjs because it requires changing the mdast node.type
The text was updated successfully, but these errors were encountered:
Summary
Digging into the
gatsby-remark-prismjs
code highlights that the most common HTML entities (<
,>
,"
, ```, etc) are escaped using thelodash.escape
function. I have personally encountered the requirement to expand on the number of characters escaped to include curly braces (`{`).Basic example
Allow another option in the plugin to allow for additional characters to be replaced by an encoded version.
Immediately I foresee two ways to accomplish this:
Motivation
During the support of my application, I encountered a very hard to debug the issue. The static site Server I was using (Caddy Server) was evaluating ansible handle bar code examples
{{ .. }}
as valid Caddy template variables. This was causing my server to crash.To me, the most sensible solution allows for additional HTML entities to be escaped.
I initially authored my own remark plugin to escape these entities...which did work but unfortunately, it is not compatible with the
remark-prismjs
because it requires changing themdast node.type
The text was updated successfully, but these errors were encountered: