fixup! 6119d912876deec27ba2e97f160a044e3dc08819
This commit is contained in:
parent
6a0c1ca3f8
commit
7f540505a8
1 changed files with 8 additions and 2 deletions
10
src/block.rs
10
src/block.rs
|
@ -201,8 +201,9 @@ impl Block {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f @ ('`' | ':') => {
|
f @ ('`' | ':') => {
|
||||||
let fence_length = chars.take_while(|c| *c == f).count() + 1;
|
let fence_length = (&mut chars).take_while(|c| *c == f).count() + 1;
|
||||||
(fence_length >= 3)
|
let valid_spec = !line[fence_length..].trim().chars().any(char::is_whitespace);
|
||||||
|
(valid_spec && fence_length >= 3)
|
||||||
.then(|| {
|
.then(|| {
|
||||||
u8::try_from(fence_length).ok().map(|fence_length| {
|
u8::try_from(fence_length).ok().map(|fence_length| {
|
||||||
(
|
(
|
||||||
|
@ -247,6 +248,11 @@ impl Block {
|
||||||
!line.trim().is_empty() && spaces >= (indent).into()
|
!line.trim().is_empty() && spaces >= (indent).into()
|
||||||
}
|
}
|
||||||
Self::Container(Div { fence_length }) | Self::Leaf(CodeBlock { fence_length }) => {
|
Self::Container(Div { fence_length }) | Self::Leaf(CodeBlock { fence_length }) => {
|
||||||
|
let fence = if matches!(self, Self::Container(..)) {
|
||||||
|
':'
|
||||||
|
} else {
|
||||||
|
'`'
|
||||||
|
};
|
||||||
let mut c = line.chars();
|
let mut c = line.chars();
|
||||||
!((&mut c).take((fence_length).into()).all(|c| c == ':')
|
!((&mut c).take((fence_length).into()).all(|c| c == ':')
|
||||||
&& c.next().map_or(false, char::is_whitespace))
|
&& c.next().map_or(false, char::is_whitespace))
|
||||||
|
|
Loading…
Reference in a new issue