aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/docs
diff options
context:
space:
mode:
authorGravatar Mark Daoust <markdaoust@google.com>2018-02-12 13:26:35 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-12 13:34:01 -0800
commit5bdb36e7e1f4add33a6d7f0287b5a3a0492c356f (patch)
treeae6a6cf7fe3c6703ec899af5d432b0942454d439 /tensorflow/tools/docs
parentffc82833fff68cb16b2ffc1a0fe6077016a494e7 (diff)
allow @{} links to break across lines.
PiperOrigin-RevId: 185426070
Diffstat (limited to 'tensorflow/tools/docs')
-rw-r--r--tensorflow/tools/docs/parser.py4
-rw-r--r--tensorflow/tools/docs/parser_test.py7
2 files changed, 6 insertions, 5 deletions
diff --git a/tensorflow/tools/docs/parser.py b/tensorflow/tools/docs/parser.py
index 3db164c2b5..e758229535 100644
--- a/tensorflow/tools/docs/parser.py
+++ b/tensorflow/tools/docs/parser.py
@@ -111,8 +111,8 @@ SYMBOL_REFERENCE_RE = re.compile(
r"""
# Start with a literal "@{".
@\{
- # Group at least 1 symbol: not "}" or "\n".
- ([^}\n]+)
+ # Group at least 1 symbol, not "}".
+ ([^}]+)
# Followed by a closing "}"
\}
""",
diff --git a/tensorflow/tools/docs/parser_test.py b/tensorflow/tools/docs/parser_test.py
index 8a0e9af521..fca5436ca5 100644
--- a/tensorflow/tools/docs/parser_test.py
+++ b/tensorflow/tools/docs/parser_test.py
@@ -76,8 +76,9 @@ class ParserTest(googletest.TestCase):
pass
string = (
- 'A @{tf.reference}, another @{tf.reference}, a member '
- '@{tf.reference.foo}, and a @{tf.third$link `text` with `code` in it}.')
+ 'A @{tf.reference}, another @{tf.reference$with\nnewline}, a member '
+ '@{tf.reference.foo}, and a @{tf.third$link `text` with `code` in '
+ 'it}.')
duplicate_of = {'tf.third': 'tf.fourth'}
index = {'tf.reference': HasOneMember,
'tf.reference.foo': HasOneMember.foo,
@@ -93,7 +94,7 @@ class ParserTest(googletest.TestCase):
self.assertEqual('A <a href="../../tf/reference.md">'
'<code>tf.reference</code></a>, '
'another <a href="../../tf/reference.md">'
- '<code>tf.reference</code></a>, '
+ 'with\nnewline</a>, '
'a member <a href="../../tf/reference.md#foo">'
'<code>tf.reference.foo</code></a>, '
'and a <a href="../../tf/fourth.md">link '