Commit graph

32 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
Cameron Moore
5e417f871d Fix typos in godocs comments 2020-12-17 10:51:19 -06:00
yuin
7b90f04af4 Refactoring 2020-08-26 20:22:51 +09:00
yuin
bd58441cc1 Fixes #78 2020-07-21 19:32:52 +09:00
yuin
3c3d4481ef Fixes #141 2020-07-02 15:44:34 +09:00
Johannes Lauinger
2141537561
update util_unsafe.go to use simpler, yet still safe, cast 2020-06-03 15:45:44 +02:00
Johannes Lauinger
813d953eeb
fix possible memory confusion in unsafe slice cast 2020-05-31 21:32:17 +02:00
yuin
12fc98ebcd Fixes #120 2020-04-01 02:10:28 +09:00
yuin
785b85a76a Fixes #115 2020-03-25 15:39:51 +09:00
yuin
a727b5adb2 Fixes #103 2020-02-18 21:18:57 +09:00
pzl
8bdab9449a
documentation typo fixes 2020-02-14 22:03:49 -05:00
yuin
2aab93edb4 Fixes tests 2019-12-20 11:12:24 +09:00
yuin
6d2e5fddae Fix #64 and some lint warnings 2019-12-16 11:08:45 +09:00
yuin
ec246695c5 Fix fail on go1.12 2019-12-08 19:00:20 +09:00
yuin
7d8bee11ca Closes #33 : Now NodeRenderers render attributes 2019-12-08 18:53:01 +09:00
Cameron Moore
3dc5ebdb17 Fix golint issues 2019-11-29 13:31:28 -06:00
yuin
6c55ba55a1 Fixes #36 2019-11-27 03:00:17 +09:00
Yusuke Inuzuka
667a2920f2 Change attribute parsing strategy 2019-08-28 20:29:23 +09:00
Liang Ding
008c258471
♻️ Simplify logic 2019-08-09 23:48:38 +08:00
yuin
a27b0ef209 Fix bugs found in fuzzing 2019-07-25 16:59:07 +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
7b1dd7b221 Issue #12 : dos style newline breaks fence code block 2019-05-23 11:27:25 +09:00
yuin
1963434c50 Fix some vet errors, Improve attributes on ATXHeadings 2019-05-16 12:37:49 +09:00
yuin
31fd0f6b4c Issue #3 : failed to parse attributes 2019-05-15 17:43:57 +09:00
yuin
ad605c0a32 Performance optimizations 2019-05-06 12:34:17 +09:00
yuin
785421acb4 Add WithAttribute 2019-05-05 13:42:39 +09:00
yuin
bdde5e8472 Rename option names 2019-05-04 22:25:41 +09:00
yuin
d4d7acb277 Add a definition list extension, some refactoring 2019-05-02 22:22:05 +09:00
yuin
e7cef1b7ca Performance optimizations 2019-05-01 20:43:10 +09:00
yuin
987f65f813 Performance optimizations 2019-05-01 20:32:41 +09:00
yuin
dd89404e04 first commit 2019-04-26 20:27:01 +09:00