(inner, order)
| 7043 | // Work around nonsense dimensions being reported for stretches of |
| 7044 | // right-to-left text. |
| 7045 | function buildTokenBadBidi(inner, order) { |
| 7046 | return function(builder, text, style, startStyle, endStyle, title, css) { |
| 7047 | style = style ? style + " cm-force-border" : "cm-force-border"; |
| 7048 | var start = builder.pos, end = start + text.length; |
| 7049 | for (;;) { |
| 7050 | // Find the part that overlaps with the start of this text |
| 7051 | for (var i = 0; i < order.length; i++) { |
| 7052 | var part = order[i]; |
| 7053 | if (part.to > start && part.from <= start) break; |
| 7054 | } |
| 7055 | if (part.to >= end) return inner(builder, text, style, startStyle, endStyle, title, css); |
| 7056 | inner(builder, text.slice(0, part.to - start), style, startStyle, null, title, css); |
| 7057 | startStyle = null; |
| 7058 | text = text.slice(part.to - start); |
| 7059 | start = part.to; |
| 7060 | } |
| 7061 | }; |
| 7062 | } |
| 7063 | |
| 7064 | function buildCollapsedSpan(builder, size, marker, ignoreWidget) { |
| 7065 | var widget = !ignoreWidget && marker.widgetNode; |
no test coverage detected