(inner, order)
| 6836 | // Work around nonsense dimensions being reported for stretches of |
| 6837 | // right-to-left text. |
| 6838 | function buildTokenBadBidi(inner, order) { |
| 6839 | return function(builder, text, style, startStyle, endStyle, title) { |
| 6840 | style = style ? style + " cm-force-border" : "cm-force-border"; |
| 6841 | var start = builder.pos, end = start + text.length; |
| 6842 | for (;;) { |
| 6843 | // Find the part that overlaps with the start of this text |
| 6844 | for (var i = 0; i < order.length; i++) { |
| 6845 | var part = order[i]; |
| 6846 | if (part.to > start && part.from <= start) break; |
| 6847 | } |
| 6848 | if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title); |
| 6849 | inner(builder, text.slice(0, part.to - start), style, startStyle, null, title); |
| 6850 | startStyle = null; |
| 6851 | text = text.slice(part.to - start); |
| 6852 | start = part.to; |
| 6853 | } |
| 6854 | }; |
| 6855 | } |
| 6856 | |
| 6857 | function buildCollapsedSpan(builder, size, marker, ignoreWidget) { |
| 6858 | var widget = !ignoreWidget && marker.widgetNode; |
no test coverage detected