allow <pre> HTML elements in Luadoc via Lua.xsd

MDN's web docs describe the "HTML <pre> elements represents preformatted
text which is to be presented exactly as written in the HTML file."

It's handy for formatting multiline code examples in
LuaDocumentation.xml.
This commit is contained in:
quietly-turning
2020-06-25 03:58:57 -04:00
parent 89229ed915
commit c57279f6b8
2 changed files with 14 additions and 5 deletions
+1
View File
@@ -89,6 +89,7 @@
<xs:element name="Link" type="Link" />
<!-- HTML elements we want to let through. -->
<xs:element name="code" />
<xs:element name="pre" />
<xs:element name="br" />
<xs:element name="del" />
</xs:choice>
+13 -5
View File
@@ -106,7 +106,7 @@
font-family: monospace;
}
.descriptionText {
text-indent: 2em;
padding-left: 2em;
margin-top: 0;
margin-bottom: 0;
}
@@ -169,7 +169,7 @@
var listid = 'list_' + id;
var img = document.getElementById( imgid );
var list = document.getElementById( listid );
img.setAttribute( 'src', 'open.gif' );
list.style.display = 'block';
}
@@ -184,7 +184,7 @@
var listid = 'list_' + id;
var img = document.getElementById( imgid );
var list = document.getElementById( listid );
if( img.getAttribute('src') == 'closed.gif' )
{
img.setAttribute( 'src', 'open.gif' );
@@ -200,7 +200,7 @@
<link rel="icon" type="image/vnd.microsoft.icon" href="./favicon.ico"/>
</head>
<body>
<xsl:apply-templates />
<xsl:apply-templates />\
</body>
</html>
</xsl:template>
@@ -648,7 +648,7 @@
<xsl:sort select="@name" />
<tr class="code">
<td>
<xsl:value-of select="@name" />
</td>
<td><xsl:value-of select="@value" /></td>
@@ -670,6 +670,14 @@
</xsl:apply-templates>
</code>
</xsl:template>
<xsl:template match="sm:pre">
<xsl:param name="curclass" />
<pre>
<xsl:apply-templates>
<xsl:with-param name="curclass" select="$curclass" />
</xsl:apply-templates>
</pre>
</xsl:template>
<xsl:template match="sm:br"><br /></xsl:template>
<xsl:template match="sm:del">
<del>