diff options
| author | Sébastien d'Herbais de Thun <sebastien.d.herbais@gmail.com> | 2023-11-13 16:56:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-13 16:56:51 +0100 |
| commit | d77356a16f3d2493709f5ebd78c0ce489a4fd98c (patch) | |
| tree | 7944daf3599e05ef4a70790c0d51e90a671b016a /crates/typst-syntax | |
| parent | 7d5f6a8b7366e12409b86419d81485932cc3a70b (diff) | |
Fix potential line splitting issue in `raw` (#2674)
Diffstat (limited to 'crates/typst-syntax')
| -rw-r--r-- | crates/typst-syntax/src/lexer.rs | 2 | ||||
| -rw-r--r-- | crates/typst-syntax/src/lib.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/crates/typst-syntax/src/lexer.rs b/crates/typst-syntax/src/lexer.rs index a909dfa0..c702551c 100644 --- a/crates/typst-syntax/src/lexer.rs +++ b/crates/typst-syntax/src/lexer.rs @@ -673,7 +673,7 @@ pub fn link_prefix(text: &str) -> (&str, bool) { } /// Split text at newlines. -pub(super) fn split_newlines(text: &str) -> Vec<&str> { +pub fn split_newlines(text: &str) -> Vec<&str> { let mut s = Scanner::new(text); let mut lines = Vec::new(); let mut start = 0; diff --git a/crates/typst-syntax/src/lib.rs b/crates/typst-syntax/src/lib.rs index 5cf740e7..7ce30d9a 100644 --- a/crates/typst-syntax/src/lib.rs +++ b/crates/typst-syntax/src/lib.rs @@ -15,11 +15,13 @@ mod span; pub use self::file::{FileId, PackageSpec, PackageVersion, VirtualPath}; pub use self::highlight::{highlight, highlight_html, Tag}; pub use self::kind::SyntaxKind; -pub use self::lexer::{is_id_continue, is_id_start, is_ident, is_newline, link_prefix}; +pub use self::lexer::{ + is_id_continue, is_id_start, is_ident, is_newline, link_prefix, split_newlines, +}; pub use self::node::{LinkedChildren, LinkedNode, SyntaxError, SyntaxNode}; pub use self::parser::{parse, parse_code, parse_math}; pub use self::source::Source; pub use self::span::{Span, Spanned}; -use self::lexer::{split_newlines, LexMode, Lexer}; +use self::lexer::{LexMode, Lexer}; use self::parser::{reparse_block, reparse_markup}; |
