MCPcopy Index your code
hub / github.com/DHTMLX/gantt / buildTokenBadBidi

Function buildTokenBadBidi

samples/common/codehighlight/codemirror.js:1875–1893  ·  view source on GitHub ↗
(inner, order)

Source from the content-addressed store, hash-verified

1873 // Work around nonsense dimensions being reported for stretches of
1874 // right-to-left text.
1875 function buildTokenBadBidi(inner, order) {
1876 return function (builder, text, style, startStyle, endStyle, css, attributes) {
1877 style = style ? style + " cm-force-border" : "cm-force-border";
1878 var start = builder.pos, end = start + text.length;
1879 for (;;) {
1880 // Find the part that overlaps with the start of this text
1881 var part = (void 0);
1882 for (var i = 0; i < order.length; i++) {
1883 part = order[i];
1884 if (part.to > start && part.from <= start) { break }
1885 }
1886 if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }
1887 inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);
1888 startStyle = null;
1889 text = text.slice(part.to - start);
1890 start = part.to;
1891 }
1892 }
1893 }
1894
1895 function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
1896 var widget = !ignoreWidget && marker.widgetNode;

Callers 1

buildLineContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected