Skip to content

Commit

Permalink
Replace ?
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxwellBo committed Dec 16, 2024
1 parent 25e9c9c commit 89e637b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bibhtml/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celine/bibhtml",
"version": "3.0.0",
"version": "3.0.1",
"license": "MIT",
"exports": "./mod.ts"
}
6 changes: 3 additions & 3 deletions bibhtml/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h1>@celine/bibhtml</h1>
<th>JSR</th>
<td class="width-auto"><a href="https://jsr.io/@celine/bibhtml">jsr.io/<wbr>@celine/<wbr>bibhtml</a> + <a href="https://jsr.io/@celine/bibhtml/doc">/docs</a></td>
<th>Version</th>
<td class="width-min"><a href="https://jsr.io/@celine/bibhtml/versions" id="version">3.0.0</a>, <time id="updated">Nov 29 2024</time></td>
<td class="width-min"><a href="https://jsr.io/@celine/bibhtml/versions" id="version">3.0.1</a>, <time id="updated">Nov 29 2024</time></td>
</tr>
<script type="module">
fetch("https://npm.jsr.io/@jsr/celine__bibhtml")
Expand All @@ -122,7 +122,7 @@ <h2>Installation</h2>
Add the following script to your HTML file's <code>&lt;head&gt;</code> element:
</p>

<div id="import-container"><script type="module" src="https://esm.sh/jsr/@celine/[email protected].0"></script></div>
<div id="import-container"><script type="module" src="https://esm.sh/jsr/@celine/[email protected].1"></script></div>

<script id="import" type="module">
celine.cell("import", () => {
Expand Down Expand Up @@ -214,7 +214,7 @@ <h3><code>&lt;bh-cite&gt;</code></h3>
<p>
The <code>replace</code> attribute (which defaults to <code>"number"</code>) determines what replaces the <code>?</code> in the inner text of the first inner <code>&lt;a&gt;</code> element.
You will need to set <code>replace="none"</code> if the title of a work contains a <code>?</code> in it:
<span id="jacobs2018house-container"><bh-cite replace="#?"><a href="#jacobs2018house">Who wins when the House and the Senate are controlled by different parties?</a></bh-cite></span>
<span id="jacobs2018house-container"><bh-cite replace="none"><a href="#jacobs2018house">Who wins when the House and the Senate are controlled by different parties?</a></bh-cite></span>
</p>

<script id="jacobs2018house-cell" type="module">
Expand Down
2 changes: 1 addition & 1 deletion bibhtml/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class BibhtmlCite extends HTMLElement {
// swap ? for the reference index

if (this.replace === "number") {
clonedA!.innerText = clonedA!.innerText.replace(this.replace, (this._referenceIndex + 1).toString());
clonedA!.innerText = clonedA!.innerText.replace('?', (this._referenceIndex + 1).toString());
}

// if deref, we need to get the URL from the citation of the reference
Expand Down

0 comments on commit 89e637b

Please sign in to comment.