Skip to content

Commit

Permalink
Use lower-case arxiv as class name
Browse files Browse the repository at this point in the history
For consistency.
  • Loading branch information
lpsinger committed Sep 27, 2023
1 parent f25209b commit 35bb7ce
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/replacements.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import arXiv from './replacements/arXiv/index.js'
import arxiv from './replacements/arxiv/index.js'
import datetime from './replacements/datetime/index.js'
import doi from './replacements/doi/index.js'
import gcnCircular from './replacements/gcn-circular/index.js'
import type { FindAndReplace } from './replacements/index.js'

export const replacements: FindAndReplace[] = [
arXiv,
arxiv,
datetime,
doi,
gcnCircular,
Expand Down
4 changes: 0 additions & 4 deletions src/replacements/arXiv/test.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const articleId = /(?:\d{4}\.\d{5}|[a-z-]+\/\d{7})(?:v\d+)?/.source
export default {
find: new RegExp(`${marker}(${articleId})`, 'g'),
replace(data, text, value) {
return data('arXiv', text, value)
return data('arxiv', text, value)
},
} satisfies FindAndReplace
4 changes: 4 additions & 0 deletions src/replacements/arxiv/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<p>Old style arXiv reference: <data class="arxiv" value="astro-ph/1234567">arXiv:astro-ph/1234567</data></p>
<p>New style arXiv reference: <data class="arxiv" value="1234.56789">arXiv:1234.56789</data></p>
<p>URL references: <data class="arxiv" value="1234.56789">http://www.arxiv.org/abs/1234.56789</data>, <data class="arxiv" value="1234.56789">https://arxiv.org/abs/1234.56789</data></p>
<p>Versioned arXiv reference: <data class="arxiv" value="1234.56789v2">arXiv:1234.56789v2</data></p>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "text",
"value": "arXiv:astro-ph/1234567",
"data": {
"class": "arXiv",
"class": "arxiv",
"value": "astro-ph/1234567"
}
}
Expand All @@ -29,7 +29,7 @@
"type": "text",
"value": "arXiv:1234.56789",
"data": {
"class": "arXiv",
"class": "arxiv",
"value": "1234.56789"
}
}
Expand All @@ -46,7 +46,7 @@
"type": "text",
"value": "http://www.arxiv.org/abs/1234.56789",
"data": {
"class": "arXiv",
"class": "arxiv",
"value": "1234.56789"
}
},
Expand All @@ -58,7 +58,7 @@
"type": "text",
"value": "https://arxiv.org/abs/1234.56789",
"data": {
"class": "arXiv",
"class": "arxiv",
"value": "1234.56789"
}
}
Expand All @@ -75,7 +75,7 @@
"type": "text",
"value": "arXiv:1234.56789v2",
"data": {
"class": "arXiv",
"class": "arxiv",
"value": "1234.56789v2"
}
}
Expand Down
File renamed without changes.

0 comments on commit 35bb7ce

Please sign in to comment.