html-flow.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. /**
  2. * @import {
  3. * Code,
  4. * Construct,
  5. * Resolver,
  6. * State,
  7. * TokenizeContext,
  8. * Tokenizer
  9. * } from 'micromark-util-types'
  10. */
  11. import { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';
  12. import { htmlBlockNames, htmlRawNames } from 'micromark-util-html-tag-name';
  13. import { blankLine } from './blank-line.js';
  14. /** @type {Construct} */
  15. export const htmlFlow = {
  16. concrete: true,
  17. name: 'htmlFlow',
  18. resolveTo: resolveToHtmlFlow,
  19. tokenize: tokenizeHtmlFlow
  20. };
  21. /** @type {Construct} */
  22. const blankLineBefore = {
  23. partial: true,
  24. tokenize: tokenizeBlankLineBefore
  25. };
  26. const nonLazyContinuationStart = {
  27. partial: true,
  28. tokenize: tokenizeNonLazyContinuationStart
  29. };
  30. /** @type {Resolver} */
  31. function resolveToHtmlFlow(events) {
  32. let index = events.length;
  33. while (index--) {
  34. if (events[index][0] === 'enter' && events[index][1].type === "htmlFlow") {
  35. break;
  36. }
  37. }
  38. if (index > 1 && events[index - 2][1].type === "linePrefix") {
  39. // Add the prefix start to the HTML token.
  40. events[index][1].start = events[index - 2][1].start;
  41. // Add the prefix start to the HTML line token.
  42. events[index + 1][1].start = events[index - 2][1].start;
  43. // Remove the line prefix.
  44. events.splice(index - 2, 2);
  45. }
  46. return events;
  47. }
  48. /**
  49. * @this {TokenizeContext}
  50. * Context.
  51. * @type {Tokenizer}
  52. */
  53. function tokenizeHtmlFlow(effects, ok, nok) {
  54. const self = this;
  55. /** @type {number} */
  56. let marker;
  57. /** @type {boolean} */
  58. let closingTag;
  59. /** @type {string} */
  60. let buffer;
  61. /** @type {number} */
  62. let index;
  63. /** @type {Code} */
  64. let markerB;
  65. return start;
  66. /**
  67. * Start of HTML (flow).
  68. *
  69. * ```markdown
  70. * > | <x />
  71. * ^
  72. * ```
  73. *
  74. * @type {State}
  75. */
  76. function start(code) {
  77. // To do: parse indent like `markdown-rs`.
  78. return before(code);
  79. }
  80. /**
  81. * At `<`, after optional whitespace.
  82. *
  83. * ```markdown
  84. * > | <x />
  85. * ^
  86. * ```
  87. *
  88. * @type {State}
  89. */
  90. function before(code) {
  91. effects.enter("htmlFlow");
  92. effects.enter("htmlFlowData");
  93. effects.consume(code);
  94. return open;
  95. }
  96. /**
  97. * After `<`, at tag name or other stuff.
  98. *
  99. * ```markdown
  100. * > | <x />
  101. * ^
  102. * > | <!doctype>
  103. * ^
  104. * > | <!--xxx-->
  105. * ^
  106. * ```
  107. *
  108. * @type {State}
  109. */
  110. function open(code) {
  111. if (code === 33) {
  112. effects.consume(code);
  113. return declarationOpen;
  114. }
  115. if (code === 47) {
  116. effects.consume(code);
  117. closingTag = true;
  118. return tagCloseStart;
  119. }
  120. if (code === 63) {
  121. effects.consume(code);
  122. marker = 3;
  123. // To do:
  124. // tokenizer.concrete = true
  125. // To do: use `markdown-rs` style interrupt.
  126. // While we’re in an instruction instead of a declaration, we’re on a `?`
  127. // right now, so we do need to search for `>`, similar to declarations.
  128. return self.interrupt ? ok : continuationDeclarationInside;
  129. }
  130. // ASCII alphabetical.
  131. if (asciiAlpha(code)) {
  132. // Always the case.
  133. effects.consume(code);
  134. buffer = String.fromCharCode(code);
  135. return tagName;
  136. }
  137. return nok(code);
  138. }
  139. /**
  140. * After `<!`, at declaration, comment, or CDATA.
  141. *
  142. * ```markdown
  143. * > | <!doctype>
  144. * ^
  145. * > | <!--xxx-->
  146. * ^
  147. * > | <![CDATA[>&<]]>
  148. * ^
  149. * ```
  150. *
  151. * @type {State}
  152. */
  153. function declarationOpen(code) {
  154. if (code === 45) {
  155. effects.consume(code);
  156. marker = 2;
  157. return commentOpenInside;
  158. }
  159. if (code === 91) {
  160. effects.consume(code);
  161. marker = 5;
  162. index = 0;
  163. return cdataOpenInside;
  164. }
  165. // ASCII alphabetical.
  166. if (asciiAlpha(code)) {
  167. effects.consume(code);
  168. marker = 4;
  169. // // Do not form containers.
  170. // tokenizer.concrete = true
  171. return self.interrupt ? ok : continuationDeclarationInside;
  172. }
  173. return nok(code);
  174. }
  175. /**
  176. * After `<!-`, inside a comment, at another `-`.
  177. *
  178. * ```markdown
  179. * > | <!--xxx-->
  180. * ^
  181. * ```
  182. *
  183. * @type {State}
  184. */
  185. function commentOpenInside(code) {
  186. if (code === 45) {
  187. effects.consume(code);
  188. // // Do not form containers.
  189. // tokenizer.concrete = true
  190. return self.interrupt ? ok : continuationDeclarationInside;
  191. }
  192. return nok(code);
  193. }
  194. /**
  195. * After `<![`, inside CDATA, expecting `CDATA[`.
  196. *
  197. * ```markdown
  198. * > | <![CDATA[>&<]]>
  199. * ^^^^^^
  200. * ```
  201. *
  202. * @type {State}
  203. */
  204. function cdataOpenInside(code) {
  205. const value = "CDATA[";
  206. if (code === value.charCodeAt(index++)) {
  207. effects.consume(code);
  208. if (index === value.length) {
  209. // // Do not form containers.
  210. // tokenizer.concrete = true
  211. return self.interrupt ? ok : continuation;
  212. }
  213. return cdataOpenInside;
  214. }
  215. return nok(code);
  216. }
  217. /**
  218. * After `</`, in closing tag, at tag name.
  219. *
  220. * ```markdown
  221. * > | </x>
  222. * ^
  223. * ```
  224. *
  225. * @type {State}
  226. */
  227. function tagCloseStart(code) {
  228. if (asciiAlpha(code)) {
  229. // Always the case.
  230. effects.consume(code);
  231. buffer = String.fromCharCode(code);
  232. return tagName;
  233. }
  234. return nok(code);
  235. }
  236. /**
  237. * In tag name.
  238. *
  239. * ```markdown
  240. * > | <ab>
  241. * ^^
  242. * > | </ab>
  243. * ^^
  244. * ```
  245. *
  246. * @type {State}
  247. */
  248. function tagName(code) {
  249. if (code === null || code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {
  250. const slash = code === 47;
  251. const name = buffer.toLowerCase();
  252. if (!slash && !closingTag && htmlRawNames.includes(name)) {
  253. marker = 1;
  254. // // Do not form containers.
  255. // tokenizer.concrete = true
  256. return self.interrupt ? ok(code) : continuation(code);
  257. }
  258. if (htmlBlockNames.includes(buffer.toLowerCase())) {
  259. marker = 6;
  260. if (slash) {
  261. effects.consume(code);
  262. return basicSelfClosing;
  263. }
  264. // // Do not form containers.
  265. // tokenizer.concrete = true
  266. return self.interrupt ? ok(code) : continuation(code);
  267. }
  268. marker = 7;
  269. // Do not support complete HTML when interrupting.
  270. return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : closingTag ? completeClosingTagAfter(code) : completeAttributeNameBefore(code);
  271. }
  272. // ASCII alphanumerical and `-`.
  273. if (code === 45 || asciiAlphanumeric(code)) {
  274. effects.consume(code);
  275. buffer += String.fromCharCode(code);
  276. return tagName;
  277. }
  278. return nok(code);
  279. }
  280. /**
  281. * After closing slash of a basic tag name.
  282. *
  283. * ```markdown
  284. * > | <div/>
  285. * ^
  286. * ```
  287. *
  288. * @type {State}
  289. */
  290. function basicSelfClosing(code) {
  291. if (code === 62) {
  292. effects.consume(code);
  293. // // Do not form containers.
  294. // tokenizer.concrete = true
  295. return self.interrupt ? ok : continuation;
  296. }
  297. return nok(code);
  298. }
  299. /**
  300. * After closing slash of a complete tag name.
  301. *
  302. * ```markdown
  303. * > | <x/>
  304. * ^
  305. * ```
  306. *
  307. * @type {State}
  308. */
  309. function completeClosingTagAfter(code) {
  310. if (markdownSpace(code)) {
  311. effects.consume(code);
  312. return completeClosingTagAfter;
  313. }
  314. return completeEnd(code);
  315. }
  316. /**
  317. * At an attribute name.
  318. *
  319. * At first, this state is used after a complete tag name, after whitespace,
  320. * where it expects optional attributes or the end of the tag.
  321. * It is also reused after attributes, when expecting more optional
  322. * attributes.
  323. *
  324. * ```markdown
  325. * > | <a />
  326. * ^
  327. * > | <a :b>
  328. * ^
  329. * > | <a _b>
  330. * ^
  331. * > | <a b>
  332. * ^
  333. * > | <a >
  334. * ^
  335. * ```
  336. *
  337. * @type {State}
  338. */
  339. function completeAttributeNameBefore(code) {
  340. if (code === 47) {
  341. effects.consume(code);
  342. return completeEnd;
  343. }
  344. // ASCII alphanumerical and `:` and `_`.
  345. if (code === 58 || code === 95 || asciiAlpha(code)) {
  346. effects.consume(code);
  347. return completeAttributeName;
  348. }
  349. if (markdownSpace(code)) {
  350. effects.consume(code);
  351. return completeAttributeNameBefore;
  352. }
  353. return completeEnd(code);
  354. }
  355. /**
  356. * In attribute name.
  357. *
  358. * ```markdown
  359. * > | <a :b>
  360. * ^
  361. * > | <a _b>
  362. * ^
  363. * > | <a b>
  364. * ^
  365. * ```
  366. *
  367. * @type {State}
  368. */
  369. function completeAttributeName(code) {
  370. // ASCII alphanumerical and `-`, `.`, `:`, and `_`.
  371. if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {
  372. effects.consume(code);
  373. return completeAttributeName;
  374. }
  375. return completeAttributeNameAfter(code);
  376. }
  377. /**
  378. * After attribute name, at an optional initializer, the end of the tag, or
  379. * whitespace.
  380. *
  381. * ```markdown
  382. * > | <a b>
  383. * ^
  384. * > | <a b=c>
  385. * ^
  386. * ```
  387. *
  388. * @type {State}
  389. */
  390. function completeAttributeNameAfter(code) {
  391. if (code === 61) {
  392. effects.consume(code);
  393. return completeAttributeValueBefore;
  394. }
  395. if (markdownSpace(code)) {
  396. effects.consume(code);
  397. return completeAttributeNameAfter;
  398. }
  399. return completeAttributeNameBefore(code);
  400. }
  401. /**
  402. * Before unquoted, double quoted, or single quoted attribute value, allowing
  403. * whitespace.
  404. *
  405. * ```markdown
  406. * > | <a b=c>
  407. * ^
  408. * > | <a b="c">
  409. * ^
  410. * ```
  411. *
  412. * @type {State}
  413. */
  414. function completeAttributeValueBefore(code) {
  415. if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {
  416. return nok(code);
  417. }
  418. if (code === 34 || code === 39) {
  419. effects.consume(code);
  420. markerB = code;
  421. return completeAttributeValueQuoted;
  422. }
  423. if (markdownSpace(code)) {
  424. effects.consume(code);
  425. return completeAttributeValueBefore;
  426. }
  427. return completeAttributeValueUnquoted(code);
  428. }
  429. /**
  430. * In double or single quoted attribute value.
  431. *
  432. * ```markdown
  433. * > | <a b="c">
  434. * ^
  435. * > | <a b='c'>
  436. * ^
  437. * ```
  438. *
  439. * @type {State}
  440. */
  441. function completeAttributeValueQuoted(code) {
  442. if (code === markerB) {
  443. effects.consume(code);
  444. markerB = null;
  445. return completeAttributeValueQuotedAfter;
  446. }
  447. if (code === null || markdownLineEnding(code)) {
  448. return nok(code);
  449. }
  450. effects.consume(code);
  451. return completeAttributeValueQuoted;
  452. }
  453. /**
  454. * In unquoted attribute value.
  455. *
  456. * ```markdown
  457. * > | <a b=c>
  458. * ^
  459. * ```
  460. *
  461. * @type {State}
  462. */
  463. function completeAttributeValueUnquoted(code) {
  464. if (code === null || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96 || markdownLineEndingOrSpace(code)) {
  465. return completeAttributeNameAfter(code);
  466. }
  467. effects.consume(code);
  468. return completeAttributeValueUnquoted;
  469. }
  470. /**
  471. * After double or single quoted attribute value, before whitespace or the
  472. * end of the tag.
  473. *
  474. * ```markdown
  475. * > | <a b="c">
  476. * ^
  477. * ```
  478. *
  479. * @type {State}
  480. */
  481. function completeAttributeValueQuotedAfter(code) {
  482. if (code === 47 || code === 62 || markdownSpace(code)) {
  483. return completeAttributeNameBefore(code);
  484. }
  485. return nok(code);
  486. }
  487. /**
  488. * In certain circumstances of a complete tag where only an `>` is allowed.
  489. *
  490. * ```markdown
  491. * > | <a b="c">
  492. * ^
  493. * ```
  494. *
  495. * @type {State}
  496. */
  497. function completeEnd(code) {
  498. if (code === 62) {
  499. effects.consume(code);
  500. return completeAfter;
  501. }
  502. return nok(code);
  503. }
  504. /**
  505. * After `>` in a complete tag.
  506. *
  507. * ```markdown
  508. * > | <x>
  509. * ^
  510. * ```
  511. *
  512. * @type {State}
  513. */
  514. function completeAfter(code) {
  515. if (code === null || markdownLineEnding(code)) {
  516. // // Do not form containers.
  517. // tokenizer.concrete = true
  518. return continuation(code);
  519. }
  520. if (markdownSpace(code)) {
  521. effects.consume(code);
  522. return completeAfter;
  523. }
  524. return nok(code);
  525. }
  526. /**
  527. * In continuation of any HTML kind.
  528. *
  529. * ```markdown
  530. * > | <!--xxx-->
  531. * ^
  532. * ```
  533. *
  534. * @type {State}
  535. */
  536. function continuation(code) {
  537. if (code === 45 && marker === 2) {
  538. effects.consume(code);
  539. return continuationCommentInside;
  540. }
  541. if (code === 60 && marker === 1) {
  542. effects.consume(code);
  543. return continuationRawTagOpen;
  544. }
  545. if (code === 62 && marker === 4) {
  546. effects.consume(code);
  547. return continuationClose;
  548. }
  549. if (code === 63 && marker === 3) {
  550. effects.consume(code);
  551. return continuationDeclarationInside;
  552. }
  553. if (code === 93 && marker === 5) {
  554. effects.consume(code);
  555. return continuationCdataInside;
  556. }
  557. if (markdownLineEnding(code) && (marker === 6 || marker === 7)) {
  558. effects.exit("htmlFlowData");
  559. return effects.check(blankLineBefore, continuationAfter, continuationStart)(code);
  560. }
  561. if (code === null || markdownLineEnding(code)) {
  562. effects.exit("htmlFlowData");
  563. return continuationStart(code);
  564. }
  565. effects.consume(code);
  566. return continuation;
  567. }
  568. /**
  569. * In continuation, at eol.
  570. *
  571. * ```markdown
  572. * > | <x>
  573. * ^
  574. * | asd
  575. * ```
  576. *
  577. * @type {State}
  578. */
  579. function continuationStart(code) {
  580. return effects.check(nonLazyContinuationStart, continuationStartNonLazy, continuationAfter)(code);
  581. }
  582. /**
  583. * In continuation, at eol, before non-lazy content.
  584. *
  585. * ```markdown
  586. * > | <x>
  587. * ^
  588. * | asd
  589. * ```
  590. *
  591. * @type {State}
  592. */
  593. function continuationStartNonLazy(code) {
  594. effects.enter("lineEnding");
  595. effects.consume(code);
  596. effects.exit("lineEnding");
  597. return continuationBefore;
  598. }
  599. /**
  600. * In continuation, before non-lazy content.
  601. *
  602. * ```markdown
  603. * | <x>
  604. * > | asd
  605. * ^
  606. * ```
  607. *
  608. * @type {State}
  609. */
  610. function continuationBefore(code) {
  611. if (code === null || markdownLineEnding(code)) {
  612. return continuationStart(code);
  613. }
  614. effects.enter("htmlFlowData");
  615. return continuation(code);
  616. }
  617. /**
  618. * In comment continuation, after one `-`, expecting another.
  619. *
  620. * ```markdown
  621. * > | <!--xxx-->
  622. * ^
  623. * ```
  624. *
  625. * @type {State}
  626. */
  627. function continuationCommentInside(code) {
  628. if (code === 45) {
  629. effects.consume(code);
  630. return continuationDeclarationInside;
  631. }
  632. return continuation(code);
  633. }
  634. /**
  635. * In raw continuation, after `<`, at `/`.
  636. *
  637. * ```markdown
  638. * > | <script>console.log(1)</script>
  639. * ^
  640. * ```
  641. *
  642. * @type {State}
  643. */
  644. function continuationRawTagOpen(code) {
  645. if (code === 47) {
  646. effects.consume(code);
  647. buffer = '';
  648. return continuationRawEndTag;
  649. }
  650. return continuation(code);
  651. }
  652. /**
  653. * In raw continuation, after `</`, in a raw tag name.
  654. *
  655. * ```markdown
  656. * > | <script>console.log(1)</script>
  657. * ^^^^^^
  658. * ```
  659. *
  660. * @type {State}
  661. */
  662. function continuationRawEndTag(code) {
  663. if (code === 62) {
  664. const name = buffer.toLowerCase();
  665. if (htmlRawNames.includes(name)) {
  666. effects.consume(code);
  667. return continuationClose;
  668. }
  669. return continuation(code);
  670. }
  671. if (asciiAlpha(code) && buffer.length < 8) {
  672. // Always the case.
  673. effects.consume(code);
  674. buffer += String.fromCharCode(code);
  675. return continuationRawEndTag;
  676. }
  677. return continuation(code);
  678. }
  679. /**
  680. * In cdata continuation, after `]`, expecting `]>`.
  681. *
  682. * ```markdown
  683. * > | <![CDATA[>&<]]>
  684. * ^
  685. * ```
  686. *
  687. * @type {State}
  688. */
  689. function continuationCdataInside(code) {
  690. if (code === 93) {
  691. effects.consume(code);
  692. return continuationDeclarationInside;
  693. }
  694. return continuation(code);
  695. }
  696. /**
  697. * In declaration or instruction continuation, at `>`.
  698. *
  699. * ```markdown
  700. * > | <!-->
  701. * ^
  702. * > | <?>
  703. * ^
  704. * > | <!q>
  705. * ^
  706. * > | <!--ab-->
  707. * ^
  708. * > | <![CDATA[>&<]]>
  709. * ^
  710. * ```
  711. *
  712. * @type {State}
  713. */
  714. function continuationDeclarationInside(code) {
  715. if (code === 62) {
  716. effects.consume(code);
  717. return continuationClose;
  718. }
  719. // More dashes.
  720. if (code === 45 && marker === 2) {
  721. effects.consume(code);
  722. return continuationDeclarationInside;
  723. }
  724. return continuation(code);
  725. }
  726. /**
  727. * In closed continuation: everything we get until the eol/eof is part of it.
  728. *
  729. * ```markdown
  730. * > | <!doctype>
  731. * ^
  732. * ```
  733. *
  734. * @type {State}
  735. */
  736. function continuationClose(code) {
  737. if (code === null || markdownLineEnding(code)) {
  738. effects.exit("htmlFlowData");
  739. return continuationAfter(code);
  740. }
  741. effects.consume(code);
  742. return continuationClose;
  743. }
  744. /**
  745. * Done.
  746. *
  747. * ```markdown
  748. * > | <!doctype>
  749. * ^
  750. * ```
  751. *
  752. * @type {State}
  753. */
  754. function continuationAfter(code) {
  755. effects.exit("htmlFlow");
  756. // // Feel free to interrupt.
  757. // tokenizer.interrupt = false
  758. // // No longer concrete.
  759. // tokenizer.concrete = false
  760. return ok(code);
  761. }
  762. }
  763. /**
  764. * @this {TokenizeContext}
  765. * Context.
  766. * @type {Tokenizer}
  767. */
  768. function tokenizeNonLazyContinuationStart(effects, ok, nok) {
  769. const self = this;
  770. return start;
  771. /**
  772. * At eol, before continuation.
  773. *
  774. * ```markdown
  775. * > | * ```js
  776. * ^
  777. * | b
  778. * ```
  779. *
  780. * @type {State}
  781. */
  782. function start(code) {
  783. if (markdownLineEnding(code)) {
  784. effects.enter("lineEnding");
  785. effects.consume(code);
  786. effects.exit("lineEnding");
  787. return after;
  788. }
  789. return nok(code);
  790. }
  791. /**
  792. * A continuation.
  793. *
  794. * ```markdown
  795. * | * ```js
  796. * > | b
  797. * ^
  798. * ```
  799. *
  800. * @type {State}
  801. */
  802. function after(code) {
  803. return self.parser.lazy[self.now().line] ? nok(code) : ok(code);
  804. }
  805. }
  806. /**
  807. * @this {TokenizeContext}
  808. * Context.
  809. * @type {Tokenizer}
  810. */
  811. function tokenizeBlankLineBefore(effects, ok, nok) {
  812. return start;
  813. /**
  814. * Before eol, expecting blank line.
  815. *
  816. * ```markdown
  817. * > | <div>
  818. * ^
  819. * |
  820. * ```
  821. *
  822. * @type {State}
  823. */
  824. function start(code) {
  825. effects.enter("lineEnding");
  826. effects.consume(code);
  827. effects.exit("lineEnding");
  828. return effects.attempt(blankLine, ok, nok);
  829. }
  830. }