Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion _plugins/content_typography.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ module Parser
class Kramdown
prepend(Module.new do
def add_link(el, *args)
el.attr['class'] = [*el.attr['class'], 'usa-link'].join(' ') if el.type == :a
add_link_class!(el) if el.type == :a
super(el, *args)
end

def parse_autolink
*children, el = super
add_link_class!(el)
[*children, el]
Comment on lines +11 to +13
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end

def add_link_class!(el)
el.attr['class'] = [*el.attr['class'], 'usa-link'].join(' ')
end
end)
end
end
Expand Down