You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2011/05/27 22:40:44 UTC
svn commit: r1128449 -
/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/util/FormattingUtils.java
Author: scottbw
Date: Fri May 27 20:40:44 2011
New Revision: 1128449
URL: http://svn.apache.org/viewvc?rev=1128449&view=rev
Log:
Added simplified method for formatting bidi overrides that also works for nested <span> tags.
Modified:
incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/util/FormattingUtils.java
Modified: incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/util/FormattingUtils.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/util/FormattingUtils.java?rev=1128449&r1=1128448&r2=1128449&view=diff
==============================================================================
--- incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/util/FormattingUtils.java (original)
+++ incubator/wookie/trunk/parser/java/src/org/apache/wookie/w3c/util/FormattingUtils.java Fri May 27 20:40:44 2011
@@ -166,20 +166,11 @@ public class FormattingUtils {
* @return a String with corrected BIDI properties
*/
private static String reformatSpan(String value){
-
- String mode="embed";
- if (value.contains("lro")){
- value = value.replace("lro", "ltr");
- mode = "bidi-override";
- }
- if (value.contains("rlo")){
- value = value.replace("rlo", "rtl");
- mode = "bidi-override";
- }
-
- value = value.replace("span dir=\"", "span style=\"unicode-bidi:"+mode+"; direction:");
-
- return value;
+ value = value.replace("span dir=\"rtl\"", "span style=\"unicode-bidi:embed; direction:rtl\"");
+ value = value.replace("span dir=\"ltr\"", "span style=\"unicode-bidi:embed; direction:ltr\"");
+ value = value.replace("span dir=\"lro\"", "span style=\"unicode-bidi:bidi-override; direction:ltr\"");
+ value = value.replace("span dir=\"rlo\"", "span style=\"unicode-bidi:bidi-override; direction:rtl\"");
+ return value;
}
}