Commit Graph

435 Commits (master)

Author SHA1 Message Date
Dmitri Shuralyov e96880f42b
README: make a definitive decision on v2 import path
This change makes it clear that the v2 import path
is github.com/russross/blackfriday/v2, and updates
various links accordingly.

See https://github.com/russross/blackfriday/issues/587#issuecomment-703393820 for details.

This change also converges the README for v1 and v2
to be consistent, as they've started to drift apart.
(See PR #675 for the equivalent change to the README
on v2 branch.)

For #587.

GitHub-Pull-Request: #674
2020-10-26 23:46:40 -04:00
Russ Ross abb995c466
Merge pull request #586 from kolyshkin/gomod
go.mod: add go version
2020-03-25 09:18:22 -06:00
Kir Kolyshkin 665c4def65 go.mod: add go version
This is a result of running `go mod tidy` using go 1.13.6.

In my devel toolchain (vim-go -> gopls -> go 1.13), go apparently
wants to add this line to go.mod, but since the modules are read-only,
it fails, which leads to gopls failing, too.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-03-23 19:11:51 -07:00
Russ Ross 41c5fccfd6
Merge pull request #559 from alanhdu/patch-1
Add <details> to recognized HTML5 block tags
2020-02-18 16:49:12 -07:00
Russ Ross 75d2440b2e
Merge pull request #570 from orf/add-no-opener
Backport noopener links to v1
2020-02-18 16:47:11 -07:00
Russ Ross 89e6d96148
Merge pull request #580 from MarkAtwood/master
Update LICENSE.txt
2020-02-18 16:43:38 -07:00
Mark Atwood c04ab11830
Update LICENSE.txt
License is not changed.  Remove line quote characters so that license scanners can recognize the license.
2020-02-03 13:41:32 -08:00
Tom Forbes 41eb1fe8a7
Backport noopener links (from commit 670777b536) 2019-09-22 15:27:07 +01:00
Alan Du e2f6cd9f54
Add <summary> tag too 2019-08-20 17:54:39 -04:00
Alan Du 5c6bc5df8a
Add <details> to recognized HTML5 block tags
Closes #525
2019-08-20 17:40:27 -04:00
Anatoly Milkov a925a152c1 README: update URL of LaTeX renderer (#465)
It has moved from Bitbucket, first to GitHub, then to GitLab.
Point to its latest location.

Updates #388.
2019-06-16 15:52:46 -04:00
Christian Oliff f3ccc8fc06 https link to GitHub (#538) 2019-04-17 22:17:06 +03:00
Ignas Anikevicius a477dd1646 Fix fenced code in lists (#521)
This attempts to fix #495 and #485.

Note the test cases which were added at the bottom of the list. The first added test case was passing even before the changes, but the second was not.
2019-01-24 10:23:35 +02:00
Iskander (Alex) Sharipov 13768b07fa readme: use fenced code blocks (#519)
It's more consistent and it's possible to mark code blocks with "go" hint,
so we get syntax highlighting on GitHub.
2019-01-20 20:42:03 +02:00
autopp 8c3eacd7a5 Fix checking of backslash in link text (#510) (#512) 2019-01-20 20:38:36 +02:00
Harald Nordgren abafa45cd8 Bump Go versions (#499) 2018-11-15 22:38:43 +02:00
Bjørn Erik Pedersen 05f3235734 Add go.mod (#488) 2018-09-17 21:59:06 +03:00
Tim Fogarty f1f45ab762 Fix block parsing for fenced code blocks in lists (#476)
This is a backport of the initial fix in v2 (#372).
2018-08-29 21:04:01 +03:00
Vytautas Šaltenis 46c73eb196
Add a link to bfchroma, glue library with Chroma (#400)
Chroma is a general purpose code highlighting library, and bfchroma
provides an easy to use glue layer for Blackfriday to interface with
Chroma.

Fixes #10.
2018-08-04 13:11:49 +03:00
Vytautas Šaltenis 34d6fae961
Don't run tests against ancient versions on Travis (#438)
Don't run tests against ancient versions on Travis.
2018-08-04 13:08:49 +03:00
Nathan Glenn 11635eb403 Accept info strings in code fences (#448)
* Accept info strings in code fences

According to the common mark standard, code fence info strings can be anything,
not just single words. Update the tests and parser accordingly.

The formatter already expected an info string with a language and HTML classes,
so this does not need to change. Update the LaTeX formatter to take the first
word of the info string as the language.

Fixes #410 (in v1).

* Don't output whole info string as code classes

This follows the common mark specification.

* run go fmt
2018-04-28 13:25:19 +03:00
Yoshiya Hinosawa 16ac584625 docs(README.md): fix typo (#451) 2018-04-26 21:50:03 +03:00
Vytautas Šaltenis 55d61fa8aa
Merge pull request #433 from IainHaslam/master
Fix HTML5 by removing rel="footnote" which is invalid.
2018-02-18 11:36:01 +02:00
Iain Haslam 338ca359c1 Fix HTML5 by removing rel="footnote" which is invalid.
Resolves #336.
2018-02-16 22:21:04 +00:00
Vytautas Šaltenis 8db9055e38
Merge pull request #432 from vassudanagunta/patch-1
Fix broken link to v2 in README
2018-02-12 10:28:20 +02:00
Vas Sudanagunta e32caebbc7
Fix broken link to v2 in README 2018-02-07 15:16:47 -05:00
Vytautas Šaltenis 6d1ef893fc Merge pull request #354 from russross/readme-for-v2
Document V2 in master README
2017-10-11 21:22:19 +03:00
Vytautas Šaltenis 8249792ba8 Update on import paths and dep transitive import FAQ
Update usage and import paths with and without package management.
Document the dep transitive dependency issue and how to get around it.
Couple more minor edits.
2017-10-07 12:41:58 +03:00
Vytautas Šaltenis 8ad7e40db0 Update README with the latest changes from v2 2017-10-07 11:14:28 +03:00
Vytautas Šaltenis a03b7ee643 Add v1 import path, fix Bluemonday code snippet 2017-10-07 11:14:28 +03:00
Vytautas Šaltenis 52dd06192f Badges back to heading, reference v1 docs explicitly 2017-10-07 11:14:28 +03:00
Vytautas Šaltenis ad4c953876 Put row of badges above the top level heading 2017-10-07 11:14:28 +03:00
Vytautas Šaltenis 74be510331 Document V2 in master README 2017-10-07 11:14:28 +03:00
Vytautas Šaltenis 4048872b16 Merge pull request #379 from bep/guillemets
Add Smartypants support for French Guillemets
2017-07-28 20:53:26 +03:00
Bjørn Erik Pedersen 4ca8c28b21 Add Smartypants support for French Guillemets
This commits adds flag `HTML_SMARTYPANTS_QUOTES_NBSP` which, when combined with `HTML_USE_SMARTYPANTS` will insert non-breaking spaces between the double quotes and the contained text.

This is mostly relevant for use in French  with `HTML_SMARTYPANTS_ANGLED_QUOTES`.

It should not hurt existing code path in the performance department:

```
name                     old time/op    new time/op    delta
SmartDoubleQuotes-4    2.58µs ± 1%    2.58µs ± 1%   ~             (p=1.000 n=5+5)

name                     old alloc/op   new alloc/op   delta
SmartDoubleQuotes-4    5.27kB ± 0%    5.27kB ± 0%   ~     (all samples are equal)

name                     old allocs/op  new allocs/op  delta
SmartDoubleQuotes-4      13.0 ± 0%      13.0 ± 0%   ~     (all samples are equal)
```

Fixes #378
2017-07-27 22:08:20 +02:00
Vytautas Šaltenis 067529f716 Merge pull request #366 from choueric/master
fix duplicate and recursive footnotes. (#241)
2017-06-10 20:02:32 +03:00
choueric 5b2fb1b893 use map[string]struct{} as a set.
Use map[string]struct{} instead of map[string]bool to implement a set
and reduce memory space.
2017-06-10 22:24:27 +08:00
choueric 8c89af6200 add 'notesRecord' to check footnote existence fast
It is necessary to use vector for 'notes' instead of map to keep
footnotes ordered. But checking for presence in a vector is not
efficient. So add a map variable 'notesRecord' to tackle this problem.
2017-06-09 10:20:58 +08:00
choueric a20399916c fix duplicate and recursive footnotes. (#241)
Fix the infinite loop when there is a self-refer footnote by checking if
the reference is already added into parser.notes.

It also fixes of creating duplicate footnotes through this modification.

Add coresponding testcase.
2017-06-08 14:43:56 +08:00
Dmitri Shuralyov 0ba0f2b6ed Document SanitizedAnchorName algorithm, copy implementation. (#352)
The goal of this change is to reduce number of non-standard library
packages (repositories) that blackfriday imports from 1 to 0, and in
turn, reduce the cost of importing blackfriday into other projects.

Do so by documenting the algorithm of SanitizedAnchorName, and include
a copy of the small function inside blackfriday itself. The same
functionality continues to be available in the original location,
github.com/shurcooL/sanitized_anchor_name.Create. It can be used by
existing users and those that look for a small package, and don't need
all of blackfriday functionality. Existing users of blackfriday can use
the new SanitizedAnchorName function directly and avoid an extra
package import.

Resolves #350.
2017-05-09 02:07:14 -04:00
Vytautas Šaltenis b253417e1c Merge pull request #334 from choueric/master
add an extension to handle Chinese (or CJK) newlines.
2017-04-13 20:36:32 +03:00
choueric f0bb45f44c modify testcase of joinLine.
1. delete testdata 'zhJoinLines.txt'.
2. move the testcase from markdown_test.go into block_test.go.
2017-03-17 17:21:30 +08:00
choueric 8098dab4eb add testcase for joinLines extension 2017-02-22 09:18:21 +08:00
choueric 3ffe8c7f6b add extension to join lines 2017-02-22 09:15:46 +08:00
Kévin Dunglas 5f33e7b787 Document using fenced code blocks with bluemonday (#309)
Document using fenced code blocks with bluemonday
2016-10-03 19:27:22 +03:00
Dmitri Shuralyov 35eb537633 Set LIST_ITEM_END_OF_LIST when list is at end of document. (#305)
The LIST_ITEM_END_OF_LIST flag is an internal flag passed to renderers
when rendering list items. It's normally set for the last item in the
list.

This change fixes the issue where that flag wasn't set in situations
where the Markdown document ends with the list being the last block
level item in it.

The cases above detect and set LIST_ITEM_END_OF_LIST flag when the list
ends because another thing begins, but they miss it when the end of
document is reached.

No tests here because this subtle internal behavior is hard to test and
would require quite a bit of testing/mock infrastructure.

Helps shurcooL/markdownfmt#30.
2016-09-08 23:28:54 -07:00
Dmitri Shuralyov 93622da34e Make newline mandatory for opening fence line. (#281)
This was an unintended typo/mistake in #280.

This is stricter, and it's fine. The opening fence line will always need to have a newline.

Add another test for isFenceLine.
2016-07-16 11:34:03 -04:00
Vytautas Šaltenis 4e6f303e8d Merge pull request #280 from russross/fix-279-and-refactor
Fix fenced code block rendering with content resembling references.
2016-07-15 22:37:58 +03:00
Dmitri Shuralyov a5812bb8f2 Improve fenced code block detection for first pass.
In first pass, there may not be a trailing newline after a fenced code
block yet. Make newline optional in isFenceLine when calling
fencedCodeBlock to detect the fenced code block it anyway. This is more
complex, but it avoids creating temporary buffers or modifying input in
order to maintain performance (see #148).

Document and rename fencedCode to fencedCodeBlock.

Add regression tests.

Fixes #279.
2016-07-15 15:07:43 -04:00
Dmitri Shuralyov 0049676599 Improve fence line detection.
Rename isFenceCode to isFenceLine, document it, add tests.

Add support for making newline optional, this will be needed in future
commits.
2016-07-15 14:59:57 -04:00