aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/code_text.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 13:27:16 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 13:27:16 +0200
commitc9f75249b83839130ffbc3b6dd175b0e31008cb7 (patch)
tree55012a12979e5960845a611162a9a3e340627fa5 /src/construct/code_text.rs
parent2100b41ee330ef6b088b4d7efdf8ea589a650ceb (diff)
downloadmarkdown-rs-c9f75249b83839130ffbc3b6dd175b0e31008cb7.tar.gz
markdown-rs-c9f75249b83839130ffbc3b6dd175b0e31008cb7.tar.bz2
markdown-rs-c9f75249b83839130ffbc3b6dd175b0e31008cb7.zip
Refactor examples of states
Diffstat (limited to '')
-rw-r--r--src/construct/code_text.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/construct/code_text.rs b/src/construct/code_text.rs
index 039f4b2..5e40d03 100644
--- a/src/construct/code_text.rs
+++ b/src/construct/code_text.rs
@@ -89,11 +89,10 @@ use crate::tokenizer::{Code, State, StateFnResult, Tokenizer};
/// Start of code (text).
///
/// ```markdown
-/// |`a`
-///
-/// |\``a`
-///
-/// |``a`
+/// > | `a`
+/// ^
+/// > | \`a`
+/// ^
/// ```
pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
let len = tokenizer.events.len();
@@ -114,7 +113,8 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
/// In the opening sequence.
///
/// ```markdown
-/// `|`a``
+/// > | `a`
+/// ^
/// ```
fn sequence_open(tokenizer: &mut Tokenizer, code: Code, size: usize) -> StateFnResult {
if let Code::Char('`') = code {
@@ -132,8 +132,8 @@ fn sequence_open(tokenizer: &mut Tokenizer, code: Code, size: usize) -> StateFnR
/// Between something and something else
///
/// ```markdown
-/// `|a`
-/// `a|`
+/// > | `a`
+/// ^^
/// ```
fn between(tokenizer: &mut Tokenizer, code: Code, size_open: usize) -> StateFnResult {
match code {
@@ -161,7 +161,8 @@ fn between(tokenizer: &mut Tokenizer, code: Code, size_open: usize) -> StateFnRe
/// In data.
///
/// ```markdown
-/// `a|b`
+/// > | `a`
+/// ^
/// ```
fn data(tokenizer: &mut Tokenizer, code: Code, size_open: usize) -> StateFnResult {
match code {
@@ -179,7 +180,8 @@ fn data(tokenizer: &mut Tokenizer, code: Code, size_open: usize) -> StateFnResul
/// In the closing sequence.
///
/// ```markdown
-/// ``a`|`
+/// > | `a`
+/// ^
/// ```
fn sequence_close(
tokenizer: &mut Tokenizer,