Fix example update issues introduced when switching ReSpec versions.
--- a/spec/latest/json-ld-api/index.html Wed May 30 18:17:45 2012 -0700
+++ b/spec/latest/json-ld-api/index.html Sun Jun 03 12:46:12 2012 -0700
@@ -228,39 +228,22 @@
alternateFormats: [ {uri: "diff-20120524.html", label: "diff to previous version"} ],
};
+ function _esc(s) {
+ s = s.replace(/&/g,'&');
+ s = s.replace(/>/g,'>');
+ s = s.replace(/"/g,'"');
+ s = s.replace(/</g,'<');
+ return s;
+ }
+
function updateExample(doc, content) {
// perform transformations to make it render and prettier
content = content.replace(/<!--/, '');
content = content.replace(/-->/, '');
- content = doc._esc(content);
+ content = _esc(content);
content = content.replace(/\*\*\*\*([^*]*)\*\*\*\*/g, '<span class="diff">$1</span>') ;
return content ;
}
-
- function updateDTD(doc, content) {
- // perform transformations to
- // make it render and prettier
- content = '<pre class="dtd">' + doc._esc(content) + '</pre>';
- content = content.replace(/!ENTITY % ([^ \t\r\n]*)/g, '!ENTITY <span class="entity">% $1</span>');
- content = content.replace(/!ELEMENT ([^ \t$]*)/mg, '!ELEMENT <span class="element">$1</span>');
- return content;
- }
-
- function updateSchema(doc, content) {
- // perform transformations to
- // make it render and prettier
- content = '<pre class="dtd">' + doc._esc(content) + '</pre>';
- content = content.replace(/<xs:element\s+name="([^&]*)"/g, '<xs:element name="<span class="element" id="schema_element_$1">$1</span>"') ;
- return content;
- }
-
- function updateTTL(doc, content) {
- // perform transformations to
- // make it render and prettier
- content = '<pre class="sh_sourceCode">' + doc._esc(content) + '</pre>';
- content = content.replace(/@prefix/g, '<span class="sh_keyword">@prefix</span>');
- return content;
- }
//]]>
</script>
<style type="text/css">
--- a/spec/latest/json-ld-syntax/index.html Wed May 30 18:17:45 2012 -0700
+++ b/spec/latest/json-ld-syntax/index.html Sun Jun 03 12:46:12 2012 -0700
@@ -224,39 +224,22 @@
alternateFormats: [ {uri: "diff-20120522.html", label: "diff to previous version"} ],
};
+ function _esc(s) {
+ s = s.replace(/&/g,'&');
+ s = s.replace(/>/g,'>');
+ s = s.replace(/"/g,'"');
+ s = s.replace(/</g,'<');
+ return s;
+ }
+
function updateExample(doc, content) {
// perform transformations to make it render and prettier
content = content.replace(/<!--/, '');
content = content.replace(/-->/, '');
- content = doc._esc(content);
+ content = _esc(content);
content = content.replace(/\*\*\*\*([^*]*)\*\*\*\*/g, '<span class="diff">$1</span>') ;
return content ;
}
-
- function updateDTD(doc, content) {
- // perform transformations to
- // make it render and prettier
- content = '<pre class="dtd">' + doc._esc(content) + '</pre>';
- content = content.replace(/!ENTITY % ([^ \t\r\n]*)/g, '!ENTITY <span class="entity">% $1</span>');
- content = content.replace(/!ELEMENT ([^ \t$]*)/mg, '!ELEMENT <span class="element">$1</span>');
- return content;
- }
-
- function updateSchema(doc, content) {
- // perform transformations to
- // make it render and prettier
- content = '<pre class="dtd">' + doc._esc(content) + '</pre>';
- content = content.replace(/<xs:element\s+name="([^&]*)"/g, '<xs:element name="<span class="element" id="schema_element_$1">$1</span>"') ;
- return content;
- }
-
- function updateTTL(doc, content) {
- // perform transformations to
- // make it render and prettier
- content = '<pre class="sh_sourceCode">' + doc._esc(content) + '</pre>';
- content = content.replace(/@prefix/g, '<span class="sh_keyword">@prefix</span>');
- return content;
- }
//]]>
</script>
<style type="text/css">