Merge pull request #10632 from demarches-simplifiees/a11y-fix-faq-content
Améliore l'accessibilité des pages de contenu de la FAQ
This commit is contained in:
commit
a415775e17
3 changed files with 8 additions and 3 deletions
|
@ -11,6 +11,11 @@ body {
|
|||
min-height: 100%;
|
||||
}
|
||||
|
||||
// Wrap text in pre tag
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
// Mobile Safari doesn't bubble mouse events by default, unless:
|
||||
//
|
||||
// - the target element of the event is a link or a form field.
|
||||
|
|
|
@ -18,7 +18,7 @@ module Redcarpet
|
|||
}
|
||||
|
||||
unless href.starts_with?('/')
|
||||
html_options.merge!(title: new_tab_suffix(title), **external_link_attributes)
|
||||
html_options.merge!(title: new_tab_suffix(content), **external_link_attributes)
|
||||
end
|
||||
|
||||
content_tag(:a, content, html_options, false)
|
||||
|
|
|
@ -10,7 +10,7 @@ RSpec.describe Redcarpet::TrustedRenderer do
|
|||
|
||||
it 'renders external links with target="_blank" and rel="noopener noreferrer"' do
|
||||
markdown = "[Visit](http://example.com)"
|
||||
expect(renderer.render(markdown)).to include('<a href="http://example.com" title="Nouvel onglet" target="_blank" rel="noopener noreferrer">Visit</a>')
|
||||
expect(renderer.render(markdown)).to include('<a href="http://example.com" title="Visit — Nouvel onglet" target="_blank" rel="noopener noreferrer">Visit</a>')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -24,7 +24,7 @@ RSpec.describe Redcarpet::TrustedRenderer do
|
|||
context 'when autolinking' do
|
||||
it 'autolinks URLs' do
|
||||
markdown = "Visit http://example.com"
|
||||
expect(renderer.render(markdown)).to include('Visit <a href="http://example.com" title="Nouvel onglet" target="_blank" rel="noopener noreferrer">http://example.com</a>')
|
||||
expect(renderer.render(markdown)).to include('Visit <a href="http://example.com" title="http://example.com — Nouvel onglet" target="_blank" rel="noopener noreferrer">http://example.com</a>')
|
||||
end
|
||||
|
||||
it 'autolinks email addresses with mailto' do
|
||||
|
|
Loading…
Reference in a new issue