Explicitly open markdown links in the same window
We were already opening them in the same window because we were accidentall sanitizing the `target` attribute, but now we're making the point more explicit.
This commit is contained in:
@@ -30,7 +30,7 @@ class MarkdownConverter
|
||||
{
|
||||
filter_html: false,
|
||||
hard_wrap: true,
|
||||
link_attributes: { target: "_blank" }
|
||||
link_attributes: {}
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -38,6 +38,12 @@ describe Legislation::DraftVersion do
|
||||
expect(legislation_draft_version.toc_html).to eq(toc_html)
|
||||
end
|
||||
|
||||
it "does not add a target attribute to links" do
|
||||
legislation_draft_version.body = "A [link](/url)"
|
||||
|
||||
expect(legislation_draft_version.body_html).to eq("<p>A <a href=\"/url\">link</a></p>\n")
|
||||
end
|
||||
|
||||
def body_markdown
|
||||
<<~BODY_MARKDOWN
|
||||
# Title 1
|
||||
|
||||
Reference in New Issue
Block a user