| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of intl; | 5 part of intl; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Bidi stands for Bi-directional text. | 8 * Bidi stands for Bi-directional text. |
| 9 * According to [Wikipedia](http://en.wikipedia.org/wiki/Bi-directional_text): | 9 * According to [Wikipedia](http://en.wikipedia.org/wiki/Bi-directional_text): |
| 10 * Bi-directional text is text containing text in both text directionalities, | 10 * Bi-directional text is text containing text in both text directionalities, |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 * HTML-escaped. | 165 * HTML-escaped. |
| 166 */ | 166 */ |
| 167 String _resetDir(String text, TextDirection direction, bool isHtml) { | 167 String _resetDir(String text, TextDirection direction, bool isHtml) { |
| 168 // endsWithRtl and endsWithLtr are called only if needed (short-circuit). | 168 // endsWithRtl and endsWithLtr are called only if needed (short-circuit). |
| 169 if ((contextDirection == TextDirection.LTR && | 169 if ((contextDirection == TextDirection.LTR && |
| 170 (direction == TextDirection.RTL || | 170 (direction == TextDirection.RTL || |
| 171 Bidi.endsWithRtl(text, isHtml))) || | 171 Bidi.endsWithRtl(text, isHtml))) || |
| 172 (contextDirection == TextDirection.RTL && | 172 (contextDirection == TextDirection.RTL && |
| 173 (direction == TextDirection.LTR || | 173 (direction == TextDirection.LTR || |
| 174 Bidi.endsWithLtr(text, isHtml)))) { | 174 Bidi.endsWithLtr(text, isHtml)))) { |
| 175 if (contextDirection == TextDirection.LTR) { | 175 return contextDirection == TextDirection.LTR ? Bidi.LRM : Bidi.RLM; |
| 176 return Bidi.LRM; | |
| 177 } else { | |
| 178 return Bidi.RLM; | |
| 179 } | |
| 180 } else { | 176 } else { |
| 181 return ''; | 177 return ''; |
| 182 } | 178 } |
| 183 } | 179 } |
| 184 } | 180 } |
| OLD | NEW |