Skip to content

Commit 286da7b

Browse files
committed
Fix for 7301594 Html.toHtml creating potentially invalid html
Generate <p dir="rtl"> instead of <p dir=rtl>. The form with the quotes is cleaner and will reduce warnings in apps that consume the output. Change-Id: Ic9879c8c882c42079598b741e897a24415d96374
1 parent 82b9464 commit 286da7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/java/android/text/Html.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ private static String getOpenParaTagWithDirection(Spanned text, int start, int e
221221
false /* no info */);
222222
switch(paraDir) {
223223
case Layout.DIR_RIGHT_TO_LEFT:
224-
return "<p dir=rtl>";
224+
return "<p dir=\"rtl\">";
225225
case Layout.DIR_LEFT_TO_RIGHT:
226226
default:
227-
return "<p dir=ltr>";
227+
return "<p dir=\"ltr\">";
228228
}
229229
}
230230

0 commit comments

Comments
 (0)