Render a Link Anchor

As opposed to a user anchor
This commit is contained in:
Edward Loveall
2021-07-04 17:06:17 -04:00
parent 5a5f68bcf8
commit bc356baa45
6 changed files with 71 additions and 5 deletions

View File

@@ -38,6 +38,16 @@ describe PageContent do
html.should eq %(<p>Hello, <em>World!</em></p><ul><li>List!</li><li>Again!</li></ul>)
end
it "renders an anchor" do
page = Page.new(nodes: [
Anchor.new(href: "https://example.com", text: "link"),
] of Child)
html = PageContent.new(page: page).render_to_string
html.should eq %(<a href="https://example.com">link</a>)
end
it "renders a blockquote" do
page = Page.new(nodes: [
BlockQuote.new(children: [