Skip to content

Add support for custom highlight tag#23

Merged
tmbb merged 2 commits intoelixir-makeup:masterfrom
msaraiva:custom-highlight-tag
Jul 1, 2019
Merged

Add support for custom highlight tag#23
tmbb merged 2 commits intoelixir-makeup:masterfrom
msaraiva:custom-highlight-tag

Conversation

@msaraiva
Copy link
Copy Markdown
Contributor

This PR adds a new option :highlight_tag to Makeup.highlight_inner_html/2. I'm not sure this is the path you wanted me to take. Let me know if you have something else in mind.

Closes #21 and #22.

@tmbb
Copy link
Copy Markdown
Collaborator

tmbb commented Jun 26, 2019

@msarava, are you still interested in contributing? Or do you prefer I take over this and change it myself?

@msaraiva
Copy link
Copy Markdown
Contributor Author

@tmbb just let me know what changes you need. I'll be glad to improve the PR.

@tmbb
Copy link
Copy Markdown
Collaborator

tmbb commented Jun 29, 2019

@msaraiva Just make the highlight tag either the first or the last argument to teh functions. I don't like having the meta argument separated from the others. After that I can merge :)

@tmbb tmbb merged commit 4397396 into elixir-makeup:master Jul 1, 2019
@msaraiva
Copy link
Copy Markdown
Contributor Author

msaraiva commented Jul 9, 2019

@tmbb many thanks for merging this. BTW, Are you planning to release a new version anytime soon? We are looking forward to seeing this feature on hex so we can update ex_doc and move the elixir-lang.org ebooks to use makeup.

Thanks again!

Copy link
Copy Markdown
Collaborator

@tmbb tmbb left a comment

Choose a reason for hiding this comment

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

@msaraiva we can now incorporate these improvements into ExDoc

@group_highlight_js "lib/makeup/formatters/html/scripts/group_highlighter_javascript.js" |> File.read!

defp render_token(escaped_value, css_class, meta) do
defp render_token(escaped_value, css_class, highlight_tag, meta) do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd prefer if highlight_tag were wither the first or the last argument. Could you change it please?

@tmbb
Copy link
Copy Markdown
Collaborator

tmbb commented Jul 15, 2019

I have released a new version

@josevalim
Copy link
Copy Markdown
Collaborator

Fantastic! Congrats on the v1.0.0 release! I think however we need a new makeup_elixir too since it depends on ~> 0.8 and now we need ~> 1.0. Can you please release a new version too? Thank you!

@tmbb
Copy link
Copy Markdown
Collaborator

tmbb commented Jul 16, 2019

@josevalim I have already released a new version, which an be incorporated into ExDoc. Maybe we should make use of the lexer discovery functionality now that it's stable?

@josevalim
Copy link
Copy Markdown
Collaborator

Oh yeah, that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace <span> with <font> to avoid reseting font-family

3 participants