Commit 68a979bd authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Removes leading whitespace from the incognito NTP text.

The items in the bulleted lists on the NTP are indented with eight
leading spaces.  This causes issues when text wraps to multiple lines,
as the subsequent lines are not indented.  Mitigate the impact of this
behavior by manually removing the leading whitespace from bulleted list
items, so that when text wraps, subsequent lines do not look as bad.

BUG=860500
TEST=The incognito NTP bulleted lists should not be indented.

Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ibbb44f33bbd5bf5c98e7c1d14814b8f183613f63
Reviewed-on: https://chromium-review.googlesource.com/1155090Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579067}
parent 6585d96a
......@@ -99,8 +99,14 @@ NSAttributedString* FormatHTMLListForUILabel(NSString* listString) {
[listString stringByReplacingOccurrencesOfString:@"<ul>" withString:@""];
listString =
[listString stringByReplacingOccurrencesOfString:@"</ul>" withString:@""];
listString = [listString stringByReplacingOccurrencesOfString:@"<li>"
withString:@"\u2022\t"];
// Use a regular expression to find and remove all leading whitespace from the
// lines which contain the "<li>" tag. This un-indents the bulleted lines.
listString = [listString
stringByReplacingOccurrencesOfString:@"\n +<li>"
withString:@"\n\u2022 "
options:NSRegularExpressionSearch
range:NSMakeRange(0, [listString length])];
listString = [listString
stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceAndNewlineCharacterSet]];
......
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