inline: disallow whitespace after/before emph
This commit is contained in:
parent
b78b2866a8
commit
d050c504ae
1 changed files with 15 additions and 0 deletions
|
@ -401,6 +401,14 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
|
||||||
if matches!(dir, Dir::Open) {
|
if matches!(dir, Dir::Open) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
if matches!(dir, Dir::Both)
|
||||||
|
&& self
|
||||||
|
.events
|
||||||
|
.back()
|
||||||
|
.map_or(false, |ev| matches!(ev.kind, EventKind::Whitespace))
|
||||||
|
{
|
||||||
|
return None;
|
||||||
|
}
|
||||||
let (d, e) = self.openers[o];
|
let (d, e) = self.openers[o];
|
||||||
let e_attr = e;
|
let e_attr = e;
|
||||||
let e_opener = e + 1;
|
let e_opener = e + 1;
|
||||||
|
@ -476,6 +484,13 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
|
||||||
if matches!(dir, Dir::Close) {
|
if matches!(dir, Dir::Close) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
if matches!(dir, Dir::Both)
|
||||||
|
&& self
|
||||||
|
.peek()
|
||||||
|
.map_or(true, |t| matches!(t.kind, lex::Kind::Whitespace))
|
||||||
|
{
|
||||||
|
return None;
|
||||||
|
}
|
||||||
self.openers.push((delim, self.events.len()));
|
self.openers.push((delim, self.events.len()));
|
||||||
// push dummy event in case attributes are encountered after closing delimiter
|
// push dummy event in case attributes are encountered after closing delimiter
|
||||||
self.events.push_back(Event {
|
self.events.push_back(Event {
|
||||||
|
|
Loading…
Reference in a new issue