Question test
This commit is contained in:
Vendored
+2
-5
@@ -213,22 +213,19 @@ function item(body, opts) {
|
|||||||
const target = picker ? detail : li;
|
const target = picker ? detail : li;
|
||||||
const first = picker ? [] : [body[0]];
|
const first = picker ? [] : [body[0]];
|
||||||
const rest = body.slice(1);
|
const rest = body.slice(1);
|
||||||
if (rest.every((l) => !startsBlockLine(l)) && !rest.includes("")) {
|
if (rest.every((_, n) => !startsBlock(body, n + 1)) && !rest.includes("")) {
|
||||||
target.append(...joinLines([...first, ...rest].map((l) => l.trim()), opts));
|
target.append(...joinLines([...first, ...rest].map((l) => l.trim()), opts));
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
const head = first;
|
const head = first;
|
||||||
let k = 1;
|
let k = 1;
|
||||||
while (k < body.length && body[k] !== "" && !startsBlockLine(body[k])) {
|
while (k < body.length && body[k] !== "" && !startsBlock(body, k)) {
|
||||||
head.push(body[k].trim());
|
head.push(body[k].trim());
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
target.append(...joinLines(head, opts), ...blocks(body.slice(k), opts));
|
target.append(...joinLines(head, opts), ...blocks(body.slice(k), opts));
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
function startsBlockLine(line) {
|
|
||||||
return fence.test(line) || heading.test(line) || quote.test(line) || bullet.test(line) || ordered.test(line);
|
|
||||||
}
|
|
||||||
function cells(line) {
|
function cells(line) {
|
||||||
let s = line.trim();
|
let s = line.trim();
|
||||||
if (s.startsWith("|")) {
|
if (s.startsWith("|")) {
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+2
-6
@@ -243,13 +243,13 @@ function item(body: string[], opts: Options): HTMLElement {
|
|||||||
const target = picker ? detail : li;
|
const target = picker ? detail : li;
|
||||||
const first = picker ? [] : [body[0]!];
|
const first = picker ? [] : [body[0]!];
|
||||||
const rest = body.slice(1);
|
const rest = body.slice(1);
|
||||||
if (rest.every((l) => !startsBlockLine(l)) && !rest.includes("")) {
|
if (rest.every((_, n) => !startsBlock(body, n + 1)) && !rest.includes("")) {
|
||||||
target.append(...joinLines([...first, ...rest].map((l) => l.trim()), opts));
|
target.append(...joinLines([...first, ...rest].map((l) => l.trim()), opts));
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
const head: string[] = first;
|
const head: string[] = first;
|
||||||
let k = 1;
|
let k = 1;
|
||||||
while (k < body.length && body[k] !== "" && !startsBlockLine(body[k]!)) {
|
while (k < body.length && body[k] !== "" && !startsBlock(body, k)) {
|
||||||
head.push(body[k]!.trim());
|
head.push(body[k]!.trim());
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
@@ -257,10 +257,6 @@ function item(body: string[], opts: Options): HTMLElement {
|
|||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
|
|
||||||
function startsBlockLine(line: string): boolean {
|
|
||||||
return fence.test(line) || heading.test(line) || quote.test(line) || bullet.test(line) || ordered.test(line);
|
|
||||||
}
|
|
||||||
|
|
||||||
function cells(line: string): string[] {
|
function cells(line: string): string[] {
|
||||||
let s = line.trim();
|
let s = line.trim();
|
||||||
if (s.startsWith("|")) {
|
if (s.startsWith("|")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user