Open adamalbrecht opened 3 years ago
Currently no, but it should be possible to do.
We don't have that many resources for new features, but I'll keep that issue in the backlog. Pull requests are very welcome.
Quick workaround:
# Add <u> and <color> inside links to style them as HTML links
your_html.gsub!(/<a ([^>]*)>(.*?)<\/a>/m, "<a \\1><u><color rgb=\"0000FF\">\\2</color></u></a>")
Requires Prawn-Markup 3.0.6 or greater!
@codez Can you outline how you'd see this implemented? I could try sending a PR. As I see it, this would mean adding a link
entry in the markup_options
hash to allow defining options, then calling start_u
and start_color
inside start_a
(and closing them in order in end_a
), and adding tests. Anything else?
Yes, I think that's a good approach. Instead of calling start_u and start_color, I would directly insert the respective tags into the text in start_a
and end_a
. Like this the code is independent of the parsing methods that work on the stack.
Is there a way to make
<a>
tags underlined and blue? If not, it would be nice if this was available to do inmarkup_option
Thanks!