Skip to content

Commit

Permalink
Rename Utils/Helpers to OutputHelpers/ValueHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
stephannv committed Jan 19, 2025
1 parent 75804ef commit 8e84b1f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private class ExamplePage
end
end

describe "utils" do
describe "output helpers" do
describe "#plain" do
it "renders plain text" do
page = ExamplePage.new
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "../../spec_helper"

describe "helpers" do
describe "value helpers" do
describe "#safe" do
it "returns an object that Blueprint will understand as safe to render without escaping" do
actual_html = Blueprint::HTML.build do
Expand Down
4 changes: 2 additions & 2 deletions src/blueprint/html.cr
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ module Blueprint::HTML
include Blueprint::HTML::BufferAppender
include Blueprint::HTML::ElementRegistrar
include Blueprint::HTML::ElementRenderer
include Blueprint::HTML::Helpers
include Blueprint::HTML::OutputHelpers
include Blueprint::HTML::Renderer
include Blueprint::HTML::StandardElements
include Blueprint::HTML::SVG
include Blueprint::HTML::Utils
include Blueprint::HTML::ValueHelpers

@buffer : String::Builder = String::Builder.new

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Blueprint::HTML::Utils
module Blueprint::HTML::OutputHelpers
private def plain(content : String) : Nil
__append_to_buffer__(content)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Blueprint::HTML::Helpers
module Blueprint::HTML::ValueHelpers
HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+)|(#[xX][\dA-Fa-f]+));)/

HTML_ESCAPE = {"&": "&amp;", ">": "&gt;", "<": "&lt;", %("): "&quot;", "'": "&#39;"}
Expand Down

0 comments on commit 8e84b1f

Please sign in to comment.