Skip to content

Commit d623839

Browse files
committed
Allow spaces inside numbered reference sequences
1 parent 5445a3c commit d623839

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn get_quote_pairs() -> HashMap<&'static str, &'static str> {
2626
lazy_static::lazy_static! {
2727
pub static ref PARENS_REGEX: Regex = Regex::new(r"[\((<{\[](?:[^\)\]}>)]|\\[\)\]}>)])*[\)\]}>)]").unwrap();
2828
pub static ref EMAIL_REGEX: Regex = Regex::new(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}").unwrap();
29-
pub static ref NUMBERED_REFERENCE_REGEX: Regex = Regex::new(r"^ ?(\[\d+])+").unwrap();
29+
pub static ref NUMBERED_REFERENCE_REGEX: Regex = Regex::new(r"^(\s*\[\d+])+").unwrap();
3030
pub static ref SPACE_AFTER_SEPARATOR: Regex = Regex::new(r"^\s+").unwrap();
3131
pub static ref QUOTES_REGEX: Regex = {
3232
let quote_pairs = get_quote_pairs();

tests/en.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ Hydrogen is a gas. [1] It is colorless, odorless, tasteless and highly flammable
259259
Hydrogen is a gas. [1]
260260
It is colorless, odorless, tasteless and highly flammable
261261
===
262+
Hydrogen is a gas. [1][2] [3] It is colorless, odorless, tasteless and highly flammable
263+
---
264+
Hydrogen is a gas. [1][2] [3]
265+
It is colorless, odorless, tasteless and highly flammable
266+
===
262267
This function (see. section 4.2) is important. Let's continue.
263268
---
264269
This function (see. section 4.2) is important.

0 commit comments

Comments
 (0)