docs/components/code_block.rb in phlex-0.4.0 vs docs/components/code_block.rb in phlex-0.5.0
- old
+ new
@@ -1,18 +1,18 @@
# frozen_string_literal: true
module Components
- class CodeBlock < Phlex::View
+ class CodeBlock < Phlex::HTML
FORMATTER = Rouge::Formatters::HTML.new
def initialize(code, syntax:)
@code = code
@syntax = syntax
end
def template
pre(class: "highlight p-5 whitespace-pre-wrap bg-stone-50") {
- raw FORMATTER.format(
+ unsafe_raw FORMATTER.format(
lexer.lex(@code)
)
}
end