Commit graph

17 commits

Author SHA1 Message Date
Karel Bilek
7cdc0fb06f Fix leading tabs with codeblocks
Note that this is a breaking change and will require new goldmark major version.

I have tried to fix problem with leading tabs in fenced code blocks (and probably normal code blocks too).

Important note - tabs do not behave like "just 4 spaces". They "finish" 4 space columns. So tab can behave like anything between 1 space to 4 spaces, depending on position.

If you have MD like this (. represents space, [tb] , [t] or [] tabs)

```
*.some.text
..```
..foo
..[]foo
..```
```

you expect the tab to be kept in the code. This did not work properly in goldmark and I fixed that.

However, if you have a code like this

```
*.some.text
..```
..foo
.[t]foo
..```
```

what should happen? I decided that it should be two spaces, as the tab is not "completely" in the code block. Similarly, what should happen in this case

```
*.some.text
..```
..foo
.[t][tb]foo
..```
```

I decided that it should be first three spaces and then tab. Not sure what even is the correct solution here...

The crux of the fix is - text segments don't have just padding, but also remember what chars is the padding and then print that, if they are called to do so in the code blocks. In other cases, the paddingChars are ignored.

This should fix #177 .
2021-01-29 14:55:55 +07:00
yuin
6c741ae251 Fixes #176 2020-12-26 18:09:14 +09:00
Cameron Moore
5e417f871d Fix typos in godocs comments 2020-12-17 10:51:19 -06:00
yuin
9e0189df27 Closes #161
- Implement footnote configurations defined in original markdown extra.
- Add OwnerDocument() method to ast.Node
- Add Meta() method to *ast.Document
2020-12-13 23:11:07 +09:00
yuin
64d4e16bf4 Fixes #65 2019-12-18 11:37:07 +09:00
yuin
7d8bee11ca Closes #33 : Now NodeRenderers render attributes 2019-12-08 18:53:01 +09:00
yuin
171dbc66a8 Fixes #50 2019-12-05 13:39:55 +09:00
Nathan Galt
6f9629fb2b Improve display of footnote backlinks
This makes three changes to backlinks:

- Inserts a space before `<a href='…'>↩</a>` to make it look better
- Uses hexadecimal references (`&#x…;`) instead of decimal references for clarity
- Adds U+FE0E VARIATION SELECTOR 15 to the ↩ to suppress emojification on both iOS and Edge on Windows

If variation selector 15 isn't appended to the ↩, then the return arrow will show up as an emoji on iOS and Edge for Windows. The Pandoc project has already run into this quirk as documented on https://github.com/jgm/pandoc/issues/5469 and they've pushed a change for their Markdown processor already.
2019-12-03 19:34:16 -08:00
yuin
2f292e5b74 Fixes #44, Fixes #45 2019-12-02 03:10:06 +09:00
yuin
54fc7c3f18 Closes #40 2019-11-29 17:03:00 +09:00
yuin
16b69522a4 Remove the WithWorkers option
Situations that concurrent inline parsing is effective are very limited
due to goroutine overheads and a parse context sharing mutex.
2019-10-31 17:46:02 +09:00
Yusuke Inuzuka
187643a437 Performance improvements, Add BlockParser.Trigger 2019-08-30 16:36:00 +09:00
yuin
21b4a046d0 Fix bugs in footnotes 2019-07-24 20:55:37 +09:00
yuin
19b18e85fc Fix bug found in fuzzing 2019-07-24 20:16:54 +09:00
yuin
883918a85c Fix bugs found in fuzzing 2019-07-18 18:01:01 +09:00
yuin
45222d6b03 Refactoring 2019-05-04 19:27:13 +09:00
yuin
e9b382fb0a Add footnote exteision 2019-05-04 19:21:33 +09:00