Earmark - Elixir's Markdown Converter

I just published Earmark Version 1.4.12 and the corresponding EarmarkParser version 1.4.12

I would have loved to progress on the issues for 1.5 but a terrible lack of resources just made it impossible

In order to honor the PRs that were stacking up I decided to release 1.4.11 and 1.4.12, enjoy

Earmark

1.4.12 2020-11-27

Adapted the CLI to accept the wikilinks switch for EarmarkParser

1.4.11 2020-11-26

EarmarkParser

1.4.12 2020/11/27

1.4.11 2020/11/26

My special thanks go to Ben Olive for his very patient wait for his wikilinks.

6 Likes

I just released a tiny new Earmark Version

N.B. Only interesting for users of compact_output: true and inline HTML

Earmark

1.4.13 2020-12-03

fixed a tiny glitch for compact output of inline HTML

3 Likes

I just released (please note version and date symmetries \o/)

Earmark

1.4.14 2021-02-21


Unfortunately this does not implement any new features on the EarmarkParser side

4 Likes

Thank you for your work on this important library. I’m using it in several projects and couldn’t do without it!

3 Likes

Links to pull requests are broken.

I second this.

Thanks for your work.

Maybe you want to setup Github Sponsors on your project?

1 Like

With fixed links to Github, sorry

1.4.14 2021-02-21

With fixed Github links – I hope

1.4.14 2021-02-21

1 Like

I just released EarmarkParser v1.4.13

This fixes a bug where IALs on list items crashed the parser

1.4.13 2021/04/18

1 Like

Here goes the compagnon release of Earmark which includes an additional PR

1.4.15 2021-04-18

1 Like

In just released EarmarkParser 1.4.15 which allows disabling of inline rendering

If this is a desired feature for Earmark (which I doubt, but I am occasionally mistaken, where occasionally ~ 99.9%)
please let me know and I will add an option and upgrade the dependency.

1.4.15 2021/08/12

2 Likes

sorry I jumped 1.4.14 my bad

Thanks for the release! Skipping a version should not be an issue in practice. :slight_smile:

3 Likes

but 1.4.14 is just a beautiful version number :sob:

4 Likes

Question time

Would it be a good idea to change links to contain rel="nofollow" and/or target="_blank"

If so, should this be done in the AST or only when rendering in Earmark?

I am not opposed to making that configurable.

Please share your insights with me.

Cheers
Robert

2 Likes

IMO it is definitely a feature of the renderer. The AST should stay as close as possible to the source.

I think the default behavior of opening in a separate tab or not is very application dependent, so an option is best. Has anyone requested this feature so far? :slight_smile:

Thanks @RobertDober for maintaining it!

2 Likes

No I just compared some Babelmark output of GFM because of a different issue and the thought crossed my mind.
José’s POV makes a lot of sense to me.

1 Like

If it helps any, in a number of custom sites I’ve put together I typically stick with this rule and it hasn’t failed yet:

  • If the hostname is my domain, don’t add these attributes
  • If the hostname is not my domain (ie. an external link)
    • If there’s no existing rel attr, add the noopener attr
    • If there’s an existing rel attr, use the existing rel attrs as is

Using noopener is the security related rel attr you’ll want to use in combination with target blank.

I know I edited and deleted my previous reply but it was correct. Using nofollow will tell search engines to ignore the link for page rankings. IMO that’s not something you would want to set by default, but using the above flow chart of conditions you can assign nofollow manually as needed (such as for user generated links in comments or another untrusted source).

I think it’s a reasonable idea to assign noopener / target new for all external links.

I’m not sure what the config API would look like but it would be neat if users had the flexibility to run custom code to determine how these attributes get applied.

For example, maybe there’s a baseline config option that says “yes, for all external links add noopener / target new”, but you could overwrite that as a user and the option accepts a function which has access to any necessary params to determine the hostname, if it’s on a subdomain, etc. basically anything needed to programmatically see if this should be set?

1 Like

thank you for your input, this surely are things I was not familiar with :blush:

if I add options to Earmark to modify the attributes of links this information will be very useful to make some meaningful alternatives.

It also implies that we might add a domain option to Earmark to give it the necessary context.

That all said I will not spend time on this unless it is useful for some folks, so please step forward if you want (or need :wink: ) this

1 Like

I’ll be completely honest with you, I don’t use Earmark but I have used this feature before with static site generators that support Markdown. It’s very convenient to be able to write out links without having to manually decorate them with rel attrs and target blank when you know it’s an external link that you want to open in a new window.

It also sets you up to be able to add little visual cues too like a tiny icon with an arrow that shows it’s an external link. Stuff like this is especially useful when you have a blog with hundreds of posts and thousands of links. Doing this thousands of times manually is tedious.

2 Likes