Caddy: blackfriday.v2 released several months ago, please consider changing markdown provider to blackfriday.v2

Created on 14 Nov 2017  路  13Comments  路  Source: caddyserver/caddy

We had a talk about it at #1785 , there you said you wanted to see v2 become more stable. Now v2 has released for months. I think it may be stable enough to change.

feature request

All 13 comments

Yes, I think it's time to do this. Anyone want to look into it? @abiosoft or @francislavoie maybe? Or @elcore if you have time?

What specific features of v2 do you think would be useful in Caddy? I noticed that they mention that v2 is about 15% slower than v1 and that you might not want to upgrade if you don't have a need for specific features in v2.

I would love to hear from @TooYoungTooSimp but #2030 points out that v2 is probably more correct, which is worth an extra (half-)millisecond or so IMO.

I'm glad to hear this information, hoping a better markdown process.

//Sorry for not checking this thread frequently because I was preparing a monthly exam.

I remember what I tried to do first is that I want to mix html tags and markdown, but not long ago I found a tricky way to do that by writing end tag like </div >(put a space before right angle brackets). This trick really do the job well.

@TooYoungTooSimp Could you give us an example of html that doesn't work right in the current version of markdown? It would be good to have a reference point to make sure that we get that fixed if possible.

@jimjimovich For a example, I want to see the markdown like

# h1
<div id="foo">

## h2

</div>

generates such html:

<h1>h1</h1>
<div id="foo">
<h2>h2</h2>
</div>

but it actually produces like this:

<h1>h1</h1>
<div id="foo">
## h2
</div>

And if I change </div> to </div >, the whole things just work as I expected.

Is blackfriday v2 mature enough for this issue to be revisited?

v2.0.1 is available. It would also be possible to do a minor vendor upgrade from 1.5 to 1.5.2 for a few fixes.

Ref: https://github.com/russross/blackfriday/releases

Sure, pull requests welcomed here.

I see blackfriday v2 is one of the required modules:

https://github.com/caddyserver/caddy/blob/bed05f2450f98f4adfe71f3ae7d6a09b9883aafa/go.mod#L27

Is this issue resolved by now?

However, I want to note that the canonical import path for blackfriday v2 when using modules is github.com/russross/blackfriday/v2, as you can see here. I would suggest you update your import paths and the require statement to use github.com/russross/blackfriday/v2, then you can remove the replace directive at the bottom.

@dmitshur Huh... 馃 I do not remember doing that intentionally for Caddy 1 (but it definitely is resolved in Caddy 2)...

In any case, yeah let's mark this as resolved, since frankly, Caddy 2 is where the development effort is now, and it's already done there. Thanks!

And I should fix the go.mod in the v2 branch with the canonical import path; will do that shortly.

Only as a side note, I replaced blackfriday with goldmark for my personal projects, since blackfriday still can't handle CLRF newlines.
Goldmark's API is also much nicer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilmacFLy picture PhilmacFLy  路  3Comments

treviser picture treviser  路  3Comments

dafanasiev picture dafanasiev  路  3Comments

mschneider82 picture mschneider82  路  3Comments

jgsqware picture jgsqware  路  3Comments