Skip to content

Commit

Permalink
Change x-ref tag to xref
Browse files Browse the repository at this point in the history
  • Loading branch information
brianorwhatever committed Mar 28, 2024
1 parent 556743f commit 76acdb6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ <h3 id="external-term-references"><a class="toc-anchor" href="#external-term-ref
<span class="token punctuation">}</span>
</code></pre>
</div>
<p>To include an external term reference within your spec use the following format <code>[[x-ref: {title}, {term}]]</code> where <code>{title}</code> is the title given to the spec in the config and <code>{term}</code> is the term being used. For example using the PE spec given in the example above <a class="term-reference" data-local-href="#term:PE:holder"
<p>To include an external term reference within your spec use the following format <code>[[xref: {title}, {term}]]</code> where <code>{title}</code> is the title given to the spec in the config and <code>{term}</code> is the term being used. For example using the PE spec given in the example above <a class="term-reference" data-local-href="#term:PE:holder"
href="https://identity.foundation/presentation-exchange#term:holder">Holder</a></p>
<h2 id="blockquote"><a class="toc-anchor" href="#blockquote" >§</a> Blockquote</h2>
<blockquote>
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = function(options = {}) {
};
const spaceRegex = /\s+/g;
const specNameRegex = /^spec$|^spec[-]*\w+$/i;
const terminologyRegex = /^def$|^ref$|^x-ref/i;
const terminologyRegex = /^def$|^ref$|^xref/i;
const specCorpus = fs.readJsonSync(modulePath + '/assets/compiled/refs.json');
const containers = require('markdown-it-container');
const md = require('markdown-it')({
Expand All @@ -102,7 +102,7 @@ module.exports = function(options = {}) {
return `<span id="term:${syn.replace(spaceRegex, '-').toLowerCase()}">${acc}</span>`;
}, primary);
}
else if (type === 'x-ref') {
else if (type === 'xref') {
const url = findExternalSpecByKey(config, token.info.args[0]);
const term = token.info.args[1].replace(spaceRegex, '-').toLowerCase();
return `<a class="term-reference" data-local-href="#term:${token.info.args[0]}:${term}"
Expand Down
2 changes: 1 addition & 1 deletion single-file-test/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ It is possible to include references to terms from external spec-up generated sp
```
:::

To include an external term reference within your spec use the following format `[[x-ref: {title}, {term}]]` where `{title}` is the title given to the spec in the config and `{term}` is the term being used. For example using the PE spec given in the example above [[x-ref: PE, Holder]]
To include an external term reference within your spec use the following format `[[xref: {title}, {term}]]` where `{title}` is the title given to the spec in the config and `{term}` is the term being used. For example using the PE spec given in the example above [[xref: PE, Holder]]

## Blockquote

Expand Down

0 comments on commit 76acdb6

Please sign in to comment.