diff --git a/.gitignore b/.gitignore index b09e783d8358d1d97b3fc23cb8d13d9a2a93a84a..58ba886c5237a164561730790b8fe92ea5f46f0f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ npm-debug.log # mac files .DS_Store + +.tool-versions diff --git a/templates/md/class.ejs b/templates/md/class.ejs index 4274f90487961e55a7ffb92a64239dc91c7f045a..84307637b09217d254f0353545735494756d3c6d 100644 --- a/templates/md/class.ejs +++ b/templates/md/class.ejs @@ -21,7 +21,10 @@ layout: default --- <% function escape(s) { - return s.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>'); + if (s) { + return s.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>'); + } + return ""; } %> # <%- clazz[consts.RDFS_LABEL] %> @@ -31,4 +34,5 @@ function escape(s) { Note: <%- clazz[consts.SKOS_NOTE] %><% } %> |Name|JSON Name|Type|Description|Immutable|Mandatory|UserEditable|Note|Example Value| |--- |--- |--- |--- |--- |--- |--- |--- |--- |<% _.forEach(clazz.properties, function (prop) { %> -| <%- prefixes.shrink(prop["@id"]) %> | <%- prop[consts.META_JSONNAME] %> | <%- model.datatypes[prop[consts.RDFS_RANGE]][consts.RDFS_LABEL] %> | <%- escape(prop[consts.RDFS_COMMENT]) %> | <%- escape(prop[consts.PROP_IMMUTABLE]) %> | <%- escape(prop[consts.PROP_MANDATORY]) %> | <%- escape(prop[consts.PROP_USEREDITABLE]) %> | <%- escape(prop[consts.SKOS_NOTE]) %> | <%- escape(prop[consts.SKOS_EXAMPLE]) %> | <% }); %> +| <%- prefixes.shrink(prop["@id"]) %> | <%- prop[consts.META_JSONNAME] %> | <%- model.datatypes[prop[consts.RDFS_RANGE]][consts.RDFS_LABEL] %> | <%- escape(prop[consts.RDFS_COMMENT]) %> | <%- escape(prop[consts.PROP_IMMUTABLE]) %> | <%- escape(prop[consts.PROP_MANDATORY]) %> | <%- escape(prop[consts.PROP_USEREDITABLE]) %> | <%- escape(prop[consts.SKOS_NOTE]) %> | <%- escape(prop[consts.SKOS_EXAMPLE]) %> | +<% }); %>