Commit graph

8 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
21437947a3 Fixes #104 : Invalid precending character breaks emphasis 2020-03-01 18:41:50 +09:00
Cameron Moore
3dc5ebdb17 Fix golint issues 2019-11-29 13:31:28 -06: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
2988e183ed Issue #2 : EOF breaks parsing 2019-05-15 00:56:22 +09:00
yuin
d4d7acb277 Add a definition list extension, some refactoring 2019-05-02 22:22:05 +09:00
yuin
dd89404e04 first commit 2019-04-26 20:27:01 +09:00