Skip to content

Commit

Permalink
Remove Advisory component
Browse files Browse the repository at this point in the history
The advisory component has been earmarked for removal.
It does not pull in styles from the design system and so has to be
manually updated if it needs changing.
'Information callouts' will be used instead.
  • Loading branch information
catalinailie committed Nov 13, 2024
1 parent f05ab86 commit af41809
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,6 @@ creates an example box

## Highlights

### Advisory (DEPRECATED: marked for removal. Use 'Information callouts' instead.)

@This is a very important message or warning@

highlights the enclosed text in yellow

```html
<h3 role="note" aria-label="Important" class="advisory">
<span>This is a very important message or warning</span>
</h3>
```

### Answer (DEPRECATED: marked for removal)

{::highlight-answer}
Expand Down
4 changes: 0 additions & 4 deletions lib/govspeak.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ def insert_strong_inside_p(body, parser = Govspeak::Document)
#{Govspeak::Document.new(body.strip).to_html}</div>\n)
end

extension("important", surrounded_by("@")) do |body|
%(\n\n<div role="note" aria-label="Important" class="advisory">#{insert_strong_inside_p(body)}</div>\n)
end

extension("helpful", surrounded_by("%")) do |body|
%(\n\n<div role="note" aria-label="Warning" class="application-notice help-notice">\n#{Govspeak::Document.new(body.strip).to_html}</div>\n)
end
Expand Down
29 changes: 0 additions & 29 deletions test/govspeak_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,27 +176,6 @@ class GovspeakTest < Minitest::Test
assert_text_output "I am very informational"
end

test_given_govspeak "@ I am very important @" do
assert_html_output %(
<div role="note" aria-label="Important" class="advisory">
<p><strong>I am very important</strong></p>
</div>)
assert_text_output "I am very important"
end

test_given_govspeak "
The following is very important
@ I am very important @
" do
assert_html_output %(
<p>The following is very important</p>
<div role="note" aria-label="Important" class="advisory">
<p><strong>I am very important</strong></p>
</div>)
assert_text_output "The following is very important I am very important"
end

test_given_govspeak "% I am very helpful %" do
assert_html_output %(
<div role="note" aria-label="Warning" class="application-notice help-notice">
Expand Down Expand Up @@ -1478,14 +1457,6 @@ class GovspeakTest < Minitest::Test
'
end

test_given_govspeak "@ Message with [a link](http://foo.bar/)@" do
assert_html_output %(
<div role="note" aria-label="Important" class="advisory">
<p><strong>Message with <a rel="external" href="http://foo.bar/">a link</a></strong></p>
</div>
)
end

test "sanitize source input by default" do
document = Govspeak::Document.new("<script>doBadThings();</script>")
assert_equal "", document.to_html.strip
Expand Down

0 comments on commit af41809

Please sign in to comment.