aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-09 15:01:46 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-09 15:01:46 +0200
commit021d5f989ae41ae39a9b937b498141d9dc70d894 (patch)
tree8009a01d69cbd4f8200ffd34fc4031265b67406e /src/parser.rs
parent344c3db875056d4aec509f24fb2dbeaf7e2a14b6 (diff)
downloadmarkdown-rs-021d5f989ae41ae39a9b937b498141d9dc70d894.tar.gz
markdown-rs-021d5f989ae41ae39a9b937b498141d9dc70d894.tar.bz2
markdown-rs-021d5f989ae41ae39a9b937b498141d9dc70d894.zip
Add basic subtokenization, string content in fenced code
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/parser.rs b/src/parser.rs
index e156e33..5648942 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -2,13 +2,21 @@
// To do: this should start with `containers`, when they’re done.
// To do: definitions and such will mean more data has to be passed around.
use crate::content::flow::flow;
-use crate::tokenizer::{as_codes, Code, Event};
+use crate::tokenizer::{as_codes, Code, Event, Point};
/// Turn a string of markdown into events.
/// Passes the codes back so the compiler can access the source.
pub fn parse(value: &str) -> (Vec<Event>, Vec<Code>) {
let codes = as_codes(value);
// To do: pass a reference to this around, and slices in the (back)feeding. Might be tough.
- let events = flow(&codes);
+ let events = flow(
+ &codes,
+ Point {
+ line: 1,
+ column: 1,
+ offset: 0,
+ },
+ 0,
+ );
(events, codes)
}