mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
doc: Changed toc filter reg.ex to be non-greedy
Stops the parsing from crashing when the content contains a ":", e.g. in web-links
This commit is contained in:
parent
9352899d69
commit
e06a57f34f
@ -24,12 +24,13 @@ class TocTreeFilt(TocTree):
|
|||||||
when it scan the src/ directory, so it's also necessary to make sure that the files
|
when it scan the src/ directory, so it's also necessary to make sure that the files
|
||||||
are covered by the exclude_patterns list in conf.py
|
are covered by the exclude_patterns list in conf.py
|
||||||
"""
|
"""
|
||||||
RE_PATTERN = re.compile(r'^\s*:(.+):\s*(.+)$')
|
RE_PATTERN = re.compile(r'^\s*:(.+?):\s*(.+)$')
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# Remove all TOC entries that should not be on display
|
# Remove all TOC entries that should not be on display
|
||||||
env = self.state.document.settings.env
|
env = self.state.document.settings.env
|
||||||
self.content = [self.filter_entry(env, e) for e in self.content if e is not None]
|
self.content = [self.filter_entry(env, e) for e in self.content if e is not None]
|
||||||
|
|
||||||
return super(TocTreeFilt, self).run()
|
return super(TocTreeFilt, self).run()
|
||||||
|
|
||||||
def filter_entry(self, env, entry):
|
def filter_entry(self, env, entry):
|
||||||
|
Loading…
Reference in New Issue
Block a user