Commit 1409681f authored by Theresa's avatar Theresa Committed by Commit Bot

Fix incognito MD bullet regexp and bullet offset in RTL

Loosen the regexp for replacing <li> tags in strings so that
translatiosn that do not contain spaces before the <li> tags don't cause
crashes.

Also fix the bullet leading margin offest in RTL to prevent the bullet
from appearing cut off.

BUG=898056,898059

Change-Id: I357e2bc8425e926a328aa3af3b0660b5cadf04ea
Reviewed-on: https://chromium-review.googlesource.com/c/1296994Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601992}
parent efa5d73b
......@@ -118,13 +118,13 @@ public class IncognitoNewTabPageViewMD extends IncognitoNewTabPageView {
// - Disambiguate the <li></li> spans for SpanApplier.
// - Remove leading whitespace (caused by formatting in the .grdp file)
// - Remove the trailing newline after the last bulletpoint.
text = text.replaceFirst(" +<li>([^<]*)</li>", "<li1>$1</li1>");
text = text.replaceFirst(" +<li>([^<]*)</li>", "<li2>$1</li2>");
text = text.replaceFirst(" +<li>([^<]*)</li>\n", "<li3>$1</li3>");
text = text.replaceFirst(" *<li>([^<]*)</li>", "<li1>$1</li1>");
text = text.replaceFirst(" *<li>([^<]*)</li>", "<li2>$1</li2>");
text = text.replaceFirst(" *<li>([^<]*)</li>\n", "<li3>$1</li3>");
// Remove the <ul></ul> tags which serve no purpose here, including the whitespace around
// them.
text = text.replaceAll(" +</?ul>\\n?", "");
text = text.replaceAll(" *</?ul>\\n?", "");
view.setText(SpanApplier.applySpans(text,
new SpanApplier.SpanInfo("<em>", "</em>",
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<resources>
<dimen name="chrome_bullet_leading_offset">-1dp</dimen>
</resources>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment