Skip to content

Commit 4fe61d8

Browse files
committed
Website updates
1 parent 9ddc3b4 commit 4fe61d8

File tree

10 files changed

+38
-18
lines changed

10 files changed

+38
-18
lines changed

dist/en/main/apidoc/module-ol_format_KML-KML.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h4 class="name">
148148

149149
<div class="tag-source">
150150
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
151-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L438">line 438</a>
151+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L437">line 437</a>
152152
</div>
153153

154154
</div>
@@ -438,7 +438,7 @@ <h4 class="name">
438438

439439
<div class="tag-source">
440440
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
441-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L916">line 916</a>
441+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L915">line 915</a>
442442
</div>
443443

444444
</div>
@@ -579,7 +579,7 @@ <h4 class="name">
579579

580580
<div class="tag-source">
581581
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
582-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L951">line 951</a>
582+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L950">line 950</a>
583583
</div>
584584

585585
</div>
@@ -1238,7 +1238,7 @@ <h4 class="name">
12381238

12391239
<div class="tag-source">
12401240
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
1241-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L708">line 708</a>
1241+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L707">line 707</a>
12421242
</div>
12431243

12441244
</div>
@@ -1379,7 +1379,7 @@ <h4 class="name">
13791379

13801380
<div class="tag-source">
13811381
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
1382-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L773">line 773</a>
1382+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L772">line 772</a>
13831383
</div>
13841384

13851385
</div>
@@ -1666,7 +1666,7 @@ <h4 class="name">
16661666

16671667
<div class="tag-source">
16681668
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
1669-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L843">line 843</a>
1669+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L842">line 842</a>
16701670
</div>
16711671

16721672
</div>
@@ -1807,7 +1807,7 @@ <h4 class="name">
18071807

18081808
<div class="tag-source">
18091809
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
1810-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L878">line 878</a>
1810+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L877">line 877</a>
18111811
</div>
18121812

18131813
</div>
@@ -2226,7 +2226,7 @@ <h4 class="name">
22262226

22272227
<div class="tag-source">
22282228
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
2229-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L984">line 984</a>
2229+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L983">line 983</a>
22302230
</div>
22312231

22322232
</div>

dist/en/main/apidoc/module-ol_format_KML.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ <h4 class="name">
308308

309309
<div class="tag-source">
310310
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js">format/KML.js</a>,
311-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L394">line 394</a>
311+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/format/KML.js#L393">line 393</a>
312312
</div>
313313

314314
</div>

dist/en/main/examples/common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/format/KML.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/format/KML.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import {
4545
readDecimal,
4646
readString,
4747
writeBooleanTextNode,
48-
writeCDATASection,
4948
writeDecimalTextNode,
5049
writeStringTextNode,
5150
} from './xsd.js';
@@ -2508,7 +2507,7 @@ function writeDataNode(node, pair, objectStack) {
25082507
* @param {string} name DisplayName.
25092508
*/
25102509
function writeDataNodeName(node, name) {
2511-
writeCDATASection(node, name);
2510+
writeStringTextNode(node, name);
25122511
}
25132512

25142513
/**

dist/en/main/ol/format/xsd.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/format/xsd.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,31 @@ export function writeNonNegativeIntegerTextNode(node, nonNegativeInteger) {
142142
node.appendChild(getDocument().createTextNode(string));
143143
}
144144

145+
const whiteSpaceStart = /^\s/;
146+
const whiteSpaceEnd = /\s$/;
147+
const cdataCharacters = /(\n|\t|\r|<|&| {2})/;
148+
145149
/**
146150
* @param {Node} node Node to append a TextNode with the string to.
147151
* @param {string} string String.
148152
*/
149153
export function writeStringTextNode(node, string) {
150-
node.appendChild(getDocument().createTextNode(string));
154+
if (
155+
typeof string === 'string' &&
156+
(whiteSpaceStart.test(string) ||
157+
whiteSpaceEnd.test(string) ||
158+
cdataCharacters.test(string))
159+
) {
160+
string.split(']]>').forEach((part, i, a) => {
161+
if (i < a.length - 1) {
162+
part += ']]';
163+
}
164+
if (i > 0) {
165+
part = '>' + part;
166+
}
167+
writeCDATASection(node, part);
168+
});
169+
} else {
170+
node.appendChild(getDocument().createTextNode(string));
171+
}
151172
}

0 commit comments

Comments
 (0)