Skip to content

Commit

Permalink
Fixed bug in section links with digits
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Aug 1, 2023
1 parent 5f6c099 commit 52d36c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@ <h3 id="1211-odata-40-minimal-conformance-level"><a name="OData40MinimalConforma
<li><a href="#HeaderODataMaxVersion"><code>OData-MaxVersion</code></a> (<a href="#HeaderODataMaxVersion">section 8.2.7</a>)</li>
</ol></li>
<li>MUST follow OData guidelines for <a href="#Extensibility">extensibility</a> (<a href="#Extensibility">section 6</a> and all subsections)</li>
<li>MUST successfully parse the request according to <a href="#ODataABNF">OData-ABNF</a> for any supported system query options and either follow the specification or return <a href="#ResponseCode501NotImplemented"><code>501 Not Implemented</code></a> for any unsupported functionality ([section 1501NotImplemented])</li>
<li>MUST successfully parse the request according to <a href="#ODataABNF">OData-ABNF</a> for any supported system query options and either follow the specification or return <a href="#ResponseCode501NotImplemented"><code>501 Not Implemented</code></a> for any unsupported functionality (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>MUST expose only data types defined in <a href="#ODataCSDL">OData-CSDLXML</a></li>
<li>MUST NOT require clients to understand any metadata or instance annotations (<a href="#VocabularyExtensibility">section 6.4</a>), custom headers (<a href="#HeaderFieldExtensibility">section 6.5</a>), or custom content (<a href="#PayloadExtensibility">section 6.2</a>) in the payload in order to correctly consume the service</li>
<li>MUST NOT violate any OData <a href="#DataModification">update semantics</a> (<a href="#DataModification">section 11.4</a> and all subsections)</li>
Expand Down Expand Up @@ -2621,7 +2621,7 @@ <h3 id="1212-odata-40-intermediate-conformance-level"><a name="OData40Intermedia
<p>In order to conform to the OData Intermediate Conformance Level, a service:</p>
<ol type="1">
<li>MUST conform to the <a href="#OData40MinimalConformanceLevel">OData 4.0 Minimal Conformance Level</a></li>
<li>MUST successfully parse the <a href="#ODataABNF">OData-ABNF</a> and either follow the specification or return <code>501 Not Implemented</code> for any unsupported functionality ([section 2501NotImplemented])</li>
<li>MUST successfully parse the <a href="#ODataABNF">OData-ABNF</a> and either follow the specification or return <code>501 Not Implemented</code> for any unsupported functionality (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>MUST support <code>$select</code> (<a href="#SystemQueryOptionselect">section 11.2.5.1</a>)`</li>
<li>MUST support casting to a derived type according to <a href="#ODataURL">OData URL</a> if derived types are present in the model</li>
<li>MUST support <code>$top</code> (<a href="#SystemQueryOptiontop">section 11.2.6.3</a>)</li>
Expand All @@ -2630,8 +2630,8 @@ <h3 id="1212-odata-40-intermediate-conformance-level"><a name="OData40Intermedia
<ol type="1">
<li>MUST support <code>eq</code>, <code>ne</code> filter operations on properties of entities in the requested entity set (<a href="#SystemQueryOptionfilter">section 11.2.6.1</a>)</li>
<li>MUST support aliases in <code>$filter</code> expressions (<a href="#ParameterAliases">section 11.2.6.1.2</a>)</li>
<li>SHOULD support additional filter operations (<a href="#BuiltinQueryFunctions">section 11.2.6.1.1</a>) and MUST return <code>501 Not Implemented</code> for any unsupported filter operations ([section 3501NotImplemented])</li>
<li>SHOULD support the canonical functions (<a href="#BuiltinQueryFunctions">section 11.2.6.1.1</a>) and MUST return <code>501 Not Implemented</code> for any unsupported canonical functions ([section 4501NotImplemented])</li>
<li>SHOULD support additional filter operations (<a href="#BuiltinQueryFunctions">section 11.2.6.1.1</a>) and MUST return <code>501 Not Implemented</code> for any unsupported filter operations (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>SHOULD support the canonical functions (<a href="#BuiltinQueryFunctions">section 11.2.6.1.1</a>) and MUST return <code>501 Not Implemented</code> for any unsupported canonical functions (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>SHOULD support <code>$filter</code> on expanded entities (<a href="#ExpandOptions">section 11.2.5.2.1</a>)</li>
</ol></li>
<li>SHOULD publish metadata at <code>$metadata</code> according to <a href="#ODataCSDL">OData-CSDLXML</a> (<a href="#MetadataDocumentRequest">section 11.1.2</a>)</li>
Expand Down Expand Up @@ -2774,7 +2774,7 @@ <h2 id="123-interoperable-odata-clients"><a name="InteroperableODataClients" hre
<li>MUST specify the <code>OData-MaxVersion</code> header in requests (<a href="#HeaderODataMaxVersion">section 8.2.7</a>)</li>
<li>MUST specify <code>OData-Version</code> (<a href="#HeaderODataVersion">section 8.1.5</a>) and <code>Content-Type</code> (<a href="#HeaderContentType">section 8.1.1</a>) in any request with a payload</li>
<li>MUST be a conforming consumer of OData as defined in <a href="#ODataJSON">OData-JSON</a></li>
<li>MUST follow redirects ([section 53xxRedirection])</li>
<li>MUST follow redirects (<a href="#ResponseCode3xxRedirection">section 9.1.5</a>)</li>
<li>MUST correctly handle next links (<a href="#ServerDrivenPaging">section 11.2.6.7</a>)</li>
<li>MUST support instances returning properties and navigation properties not specified in metadata (<a href="#RequestingData">section 11.2</a>)</li>
<li>MUST generate <code>PATCH</code> requests for updates, if the client supports updates (<a href="#UpdateanEntity">section 11.4.3</a>)</li>
Expand Down
10 changes: 5 additions & 5 deletions docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -6261,7 +6261,7 @@ request
[OData-ABNF](#ODataABNF) for any supported system query options and
either follow the specification or return
[`501 Not Implemented`](#ResponseCode501NotImplemented) for any
unsupported functionality ([section 1501NotImplemented])
unsupported functionality ([section 9.3.1](#ResponseCode501NotImplemented))
8. MUST expose only data types defined in [OData-CSDLXML](#ODataCSDL)
9. MUST NOT require clients to understand any metadata or instance
annotations ([section 6.4](#VocabularyExtensibility)), custom headers ([section 6.5](#HeaderFieldExtensibility)), or custom
Expand Down Expand Up @@ -6329,7 +6329,7 @@ service:
Level](#OData40MinimalConformanceLevel)
2. MUST successfully parse the [OData-ABNF](#ODataABNF) and either
follow the specification or return `501 Not Implemented` for any
unsupported functionality ([section 2501NotImplemented])
unsupported functionality ([section 9.3.1](#ResponseCode501NotImplemented))
3. MUST support `$select` ([section 11.2.5.1](#SystemQueryOptionselect))`
4. MUST support casting to a derived type according to
[OData URL](#ODataURL) if derived types are present in the model
Expand All @@ -6341,10 +6341,10 @@ in the requested entity set ([section 11.2.6.1](#SystemQueryOptionfilter))
2. MUST support aliases in `$filter` expressions ([section 11.2.6.1.2](#ParameterAliases))
3. SHOULD support additional filter operations ([section 11.2.6.1.1](#BuiltinQueryFunctions))
and MUST return `501 Not Implemented` for any unsupported filter
operations ([section 3501NotImplemented])
operations ([section 9.3.1](#ResponseCode501NotImplemented))
4. SHOULD support the canonical functions ([section 11.2.6.1.1](#BuiltinQueryFunctions)) and
MUST return `501 Not Implemented` for any unsupported canonical
functions ([section 4501NotImplemented])
functions ([section 9.3.1](#ResponseCode501NotImplemented))
5. SHOULD support `$filter` on expanded entities ([section 11.2.5.2.1](#ExpandOptions))
8. SHOULD publish metadata at `$metadata` according to
[OData-CSDLXML](#ODataCSDL) ([section 11.1.2](#MetadataDocumentRequest))
Expand Down Expand Up @@ -6575,7 +6575,7 @@ To be generally interoperable, OData clients
([section 8.1.1](#HeaderContentType)) in any request with a payload
3. MUST be a conforming consumer of OData as defined in
[OData-JSON](#ODataJSON)
4. MUST follow redirects ([section 53xxRedirection])
4. MUST follow redirects ([section 9.1.5](#ResponseCode3xxRedirection))
5. MUST correctly handle next links ([section 11.2.6.7](#ServerDrivenPaging))
6. MUST support instances returning properties and navigation
properties not specified in metadata ([section 11.2](#RequestingData))
Expand Down
8 changes: 4 additions & 4 deletions lib/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Number {
if (this.skip(line)) return;
for (var m, regex = /<a name="(.*?)">/g; (m = regex.exec(line)); )
this.refs[m[1]] = true;
m = line.match(/ ##([A-Za-z]+)(_([A-Za-z]+))?/);
m = line.match(/ ##([A-Za-z0-9]+)(_([A-Za-z0-9]+))?/);
if (m && line[m.index + m[0].length] !== "]") {
if (
!m[1].startsWith("sub") &&
Expand All @@ -70,7 +70,7 @@ class Number {
)
this.toc[m[1]] = { sub: [] };
if (m[1].endsWith("sec")) {
m = line.match(/ ##([A-Za-z]+)(?:_[A-Za-z]+)?\s+(.+)$/);
m = line.match(/ ##([A-Za-z0-9]+)(?:_[A-Za-z0-9]+)?\s+(.+)$/);
m[3] = m[2].replace(/[^A-Za-z0-9]/g, "");
}
this.counter[m[1]] = (this.counter[m[1]] || 0) + 1;
Expand Down Expand Up @@ -146,7 +146,7 @@ class Number {
this.errors.push(
`${this.dir}/${file}(${lineno}): Undefined link #${m[1]}`
);
m = line.match(/ ##([A-Za-z]+)(_([A-Za-z]+))?/);
m = line.match(/ ##([A-Za-z0-9]+)(_([A-Za-z0-9]+))?/);
var outline = line;
if (m && line[m.index + m[0].length] !== "]") {
var prefix = line.substring(0, m.index) + " ";
Expand All @@ -163,7 +163,7 @@ class Number {
}
out.write(
outline.replace(
/##([A-Za-z]+)\]/g,
/##([A-Za-z0-9]+)\]/g,
function (m, p) {
var r = this.refs[p];
if (r) return `${r}](#${p})`;
Expand Down

0 comments on commit 52d36c2

Please sign in to comment.