BillBryson
Customize Elixir Earmark p tag output
I’m trying to customize the outputted p tag when using Earmark.as_html!/2.
For example, I’d like this input:
Earmark.as_html!("Hello world")
To return: <p style="color: #000000;">Hello world</p>. Here the color is applied dynamically. I was looking through the docs but did not see something that would fit my needs, perhaps I missed it? Any help would be appreciated.
Most Liked
RobertDober
Sorry for blending in so late, but I needed some time to get my focus back on Earmark
As a matter of fact the split of EarmarkParser was also motivated by giving Earmark more liberties to create code that is not needed by ex_doc and its zillions of users 
Therefor I have started to implement an Ast Walker and the option to integrate an Ast Postprocessor
A good starting point on how to use it is here:
As this is WIP please do not hesistate to give me some input what might be better or more useful.
Sorry no doc yet, but I need the feature to be stable first.
Here is the implementation:
postprocess option
and Ast Walker
BillBryson
Sorry, I misread. Not a specific string of “hello world”. I want apply a style to all these p tags. This solution works, I just required a 4 element tuple in place of a 3 element one for the parse function, which the example provided.
Thank you for your help.







