/** * Line ends inside a paragraph between East Asian characters (#181). * * The lines of a paragraph or a blockquote are joined with a space, and a * resource snippet (a caption, a note, a table cell) keeps its line ends as * whitespace. Chinese and Japanese are written without spaces, so a line end * between two ideographs must vanish instead: CSS Text 3 §4.1.3 ("segment * break transformation") removes a segment break when the characters on both * sides are East Asian Wide, Fullwidth or Halfwidth and neither is Hangul, * and when either side is a zero-width space. Its second rule, for Chinese * and Japanese text, also lets either side be an ambiguous-width punctuation * mark or symbol (`“`, `”`, `…`, `—`); the parser does not know the * document's language, so a run of such marks is looked through to the * characters around it (see {@link removesLineEndAt}). Korean keeps its * spaces. */ import type { InlineSpan } from './types.js'; /** A character of the East Asian scripts whose East Asian Width is Wide, * Fullwidth or Halfwidth (UAX #11), Hangul left out: ideographs and their * radicals and strokes, kana, bopomofo, Yi, CJK punctuation and symbols, * the fullwidth and halfwidth forms, the vertical and small form variants. * Emoji (also Wide) are left out: a line end between two of them in Latin * prose keeps its space. */ export declare function isEastAsianWide(cp: number): boolean; /** Whether a line end between the code points `before` and `after` is * removed rather than set as a space (CSS Text 3 §4.1.3). */ export declare function removesSegmentBreak(before: number | undefined, after: number | undefined): boolean; /** * Whether a line end between `text[…before)` and `text[after…]` is removed. * Beside the rules of {@link removesSegmentBreak}, a line end between two * ambiguous marks (`”⏎“`, `……⏎“`, `”⏎——`) goes when the nearest character * past the marks on either side is East Asian wide and neither is Hangul: * `“你好”⏎“再见”` joins, `“hello”⏎“bye”` and `“안녕”⏎“잘 가”` keep their space. * `skip` (a placeholder such as a footnote marker's) is looked through too. */ export declare function removesLineEndAt(text: string, before: number, after: number, skip?: string): boolean; /** * Take out of a paragraph's or blockquote's mapped text the spaces that * joined two source lines between East Asian characters. A joining space is * one whose source, up to the next character's, holds the line end. * Returns `undefined` when nothing changes, so a block without Chinese text * keeps its arrays as they are. */ export declare function joinEastAsianLines(markdown: string, text: string, spans: InlineSpan[], sourceMap: number[]): { text: string; spans: InlineSpan[]; sourceMap: number[]; } | undefined; /** * Take out of a resource snippet's spans (a caption, a note, a table cell) * the line ends that fall between East Asian characters, with the spaces * and tabs around them. The snippet's own text is the source, so the map * built afterwards (`computeSourceMap`) skips them. */ export declare function joinEastAsianSnippetLines(spans: InlineSpan[]): InlineSpan[]; //# sourceMappingURL=softBreaks.d.ts.map