6493 - browse: '#'s inside lines aren't headings
This commit is contained in:
parent
8f5a26d5c2
commit
0b9cdbd0dd
|
@ -83,7 +83,7 @@ $render-normal:flush-buffered-newline: {
|
|||
}
|
||||
## end soft newline support
|
||||
|
||||
# if start of paragraph and c == '#', switch to header
|
||||
# if c == '#', switch to header
|
||||
compare c, 0x23 # '#'
|
||||
{
|
||||
break-if-!=
|
||||
|
|
|
@ -1 +1 @@
|
|||
Support headers.
|
||||
Don't treat '#'s inside lines as headers.
|
||||
|
|
|
@ -63,6 +63,20 @@ $render-normal:loop: {
|
|||
loop $render-normal:loop
|
||||
}
|
||||
}
|
||||
# if start of paragraph and c == '#', switch to header
|
||||
compare start-of-paragraph?, 0
|
||||
{
|
||||
break-if-=
|
||||
compare c, 0x23 # '#'
|
||||
{
|
||||
break-if-!=
|
||||
render-header-line fs, state
|
||||
newline-seen? <- copy 1 # true
|
||||
loop $render-normal:loop
|
||||
}
|
||||
}
|
||||
# c is not a newline
|
||||
start-of-paragraph? <- copy 0 # false
|
||||
# if c is unprintable (particularly a '\r' CR), skip it
|
||||
compare c, 0x20
|
||||
loop-if-<
|
||||
|
@ -85,15 +99,6 @@ $render-normal:flush-buffered-newline: {
|
|||
}
|
||||
## end soft newline support
|
||||
|
||||
# if start of paragraph and c == '#', switch to header
|
||||
compare c, 0x23 # '#'
|
||||
{
|
||||
break-if-!=
|
||||
render-header-line fs, state
|
||||
newline-seen? <- copy 1 # true
|
||||
loop $render-normal:loop
|
||||
}
|
||||
|
||||
# if (c == '*') switch to bold
|
||||
compare c, 0x2a # '*'
|
||||
{
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
###### abc
|
||||
|
||||
abc # def
|
||||
|
||||
abc
|
||||
def
|
||||
|
||||
|
|
Loading…
Reference in New Issue