Skip to content

Commit

Permalink
Fix alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Aug 10, 2024
1 parent 8d72cb3 commit 7e5acfb
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions smd.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export const
LIST_ORDERED = 16777216, // 24
LIST_ITEM = 33554432, // 25
CHECKBOX = 67108864, // 26
MAYBE_URL =134217728, // 27
MAYBE_TASK =268435456, // 28
MAYBE_URL =134217728, // 27
MAYBE_TASK =268435456, // 28
/** `HEADING_1 | HEADING_2 | HEADING_3 | HEADING_4 | HEADING_5 | HEADING_6` */
ANY_HEADING = 252,
/** `CODE_BLOCK | CODE_FENCE | CODE_INLINE` */
Expand Down Expand Up @@ -480,14 +480,14 @@ export function parser_write(p, chunk) {
switch (char) {
case '`':
/* ````?
^
^
*/
if (p.pending.length === p.backticks_count) {
p.pending = pending_with_char
p.backticks_count = pending_with_char.length
}
/* ```code`
^
^
*/
else {
add_token(p, PARAGRAPH)
Expand All @@ -498,7 +498,7 @@ export function parser_write(p, chunk) {
continue
case '\n':
/* ```lang\n
^
^
*/
add_token(p, CODE_FENCE)
if (p.pending.length > p.backticks_count) {
Expand All @@ -508,7 +508,7 @@ export function parser_write(p, chunk) {
continue
default:
/* ```lang\n
^
^
*/
p.pending = pending_with_char
continue
Expand Down Expand Up @@ -717,15 +717,15 @@ export function parser_write(p, chunk) {
if (symbol === p.pending) {
add_text(p)
/* **Bold**
^
^
*/
if (symbol === char) {
end_token(p)
p.pending = ""
continue
}
/* **Bold*Bold->Em*
^
^
*/
add_token(p, italic)
p.pending = char
Expand Down Expand Up @@ -763,7 +763,7 @@ export function parser_write(p, chunk) {
}
}
/* *em*foo
^
^
*/
else {
add_text(p)
Expand Down Expand Up @@ -823,7 +823,7 @@ export function parser_write(p, chunk) {
if ("]" === p.pending) {
/*
[Link](url)
^
^
*/
add_text(p)
if ('(' === char) {
Expand All @@ -839,7 +839,7 @@ export function parser_write(p, chunk) {
) {
/*
[Link](url)
^
^
*/
if (')' === char) {
const type = p.token === LINK ? HREF : SRC
Expand Down Expand Up @@ -927,14 +927,14 @@ export function parser_write(p, chunk) {

if (p.pending.length === 1) {
/* **Strong**
^
^
*/
if (symbol === char) {
p.pending = pending_with_char
continue
}
/* *Em*
^
^
*/
if (' ' !== char && '\n' !== char) {
add_text(p)
Expand All @@ -944,7 +944,7 @@ export function parser_write(p, chunk) {
}
} else {
/* ***Strong->Em***
^
^
*/
if (symbol === char) {
add_text(p)
Expand All @@ -954,7 +954,7 @@ export function parser_write(p, chunk) {
continue
}
/* **Strong**
^
^
*/
if (' ' !== char && '\n' !== char) {
add_text(p)
Expand All @@ -971,15 +971,15 @@ export function parser_write(p, chunk) {

if ("~" === p.pending) {
/* ~~Strike~~
^
^
*/
if ('~' === char) {
p.pending = pending_with_char
continue
}
} else {
/* ~~Strike~~
^
^
*/
if (' ' !== char && '\n' !== char) {
add_text(p)
Expand Down

0 comments on commit 7e5acfb

Please sign in to comment.