goldmark/parser
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
..
attribute.go Fixes #50 2019-12-05 13:39:55 +09:00
atx_heading.go Closes #124 2020-04-19 15:58:14 +09:00
auto_link.go Performance optimizations 2019-05-06 12:34:17 +09:00
blockquote.go Fix leading tabs with codeblocks 2021-01-29 14:55:55 +07:00
code_block.go Fix leading tabs with codeblocks 2021-01-29 14:55:55 +07:00
code_span.go Fix invalid handling of consecutive code spans 2019-12-02 17:13:37 +09:00
delimiter.go Fixes #141 2020-07-02 15:44:34 +09:00
emphasis.go Performance optimizations 2019-05-01 20:32:41 +09:00
fcode_block.go Fix leading tabs with codeblocks 2021-01-29 14:55:55 +07:00
html_block.go Fixes #136 2020-06-04 15:26:24 +09:00
link.go Merge pull request #171 from moorereason/unused-buf 2020-12-26 18:01:51 +09:00
link_ref.go Add a definition list extension, some refactoring 2019-05-02 22:22:05 +09:00
list.go Fix invalid handling of settext in lists 2020-03-10 16:31:55 +09:00
list_item.go Fix leading tabs with codeblocks 2021-01-29 14:55:55 +07:00
paragraph.go Performance improvements, Add BlockParser.Trigger 2019-08-30 16:36:00 +09:00
parser.go Fixes #164, Fixes #167 2020-12-26 17:56:42 +09:00
raw_html.go Remove unused global code 2020-12-17 10:26:46 -06:00
setext_headings.go put ID to generator 2019-12-22 09:46:40 +03:00
thematic_break.go Merge pull request #43 from moorereason/clean-lint 2019-12-02 03:17:56 +09:00