Skip to content

Commit

Permalink
Add a question mark in the regex to avoid backtracking.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 256379201
  • Loading branch information
yashk2810 authored and copybara-github committed Jul 3, 2019
1 parent 8dfaafa commit e196d5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/tensorflow_docs/api_generator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self, block_start, block_end):
self._block_end = block_end
self._in_block = False

self._start_end_regex = re.escape(self._block_start) + r'.*' + re.escape(
self._start_end_regex = re.escape(self._block_start) + r'.*?' + re.escape(
self._block_end)

def __call__(self, line):
Expand Down

0 comments on commit e196d5d

Please sign in to comment.