Skip to content

Commit

Permalink
add escaping for syntax blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
KonnorRogers committed Feb 10, 2024
1 parent 3f5e5a1 commit ae4d046
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/plugins/builders/inspectors.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "cgi"

class Builders::Inspectors < SiteBuilder
def build
inspect_html do |document|
Expand Down Expand Up @@ -49,7 +51,7 @@ def syntax_highlight(document)
<sl-icon class='clipboard__icon--idle' name='clipboard'></sl-icon>
</clipboard-copy>
<textarea id='#{id}' hidden>#{text}</textarea>
<textarea id='#{id}' hidden>#{CGI.escape_html(text)}</textarea>
</div>
HTML

Expand Down

0 comments on commit ae4d046

Please sign in to comment.