feat: lines macros
This commit is contained in:
parent
cc3d915877
commit
ed762a8dd4
9 changed files with 105 additions and 75 deletions
|
|
@ -15,13 +15,7 @@ impl Block {
|
|||
|
||||
let mut pos = 0;
|
||||
let end = format!(r"#+END_{}", &src[8..name]);
|
||||
while let Some(line_end) = src[pos..].find('\n').map(|i| i + pos + 1).or_else(|| {
|
||||
if pos < src.len() {
|
||||
Some(src.len())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}) {
|
||||
for line_end in lines!(src) {
|
||||
if src[pos..line_end].trim().eq_ignore_ascii_case(&end) {
|
||||
return Some((
|
||||
&src[8..name],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue