Comments (4)
Is there are reason you can't use CSS to control the display effects of the div wrappers? In some styles they are important to the structure of the cite. If you do want to omit them completely, you could extend src/formats.js with a custom output format that sets the HTML but returns unadorned text instead of the div wrappers.
from citeproc-js.
I'd like just the citation content because my app takes it and throws it into an ordered list. By doing so, it'll get numbered twice.
I suppose, now that I think about it more, I could just be tossing the citations into a containing <div>
. I'll have to play around with it more.
One other question comes to mind now that I'm thinking about html formatting. Does citeproc also return correctly formatted inline citations? If so, how do I access them? (All I really am aware of is the makeBibliography
function).
Thanks for the help!
from citeproc-js.
Ah, now I remember the reason...
I'm generally grabbing citations one at a time (but also sometimes 2-3 at a time, and other times 10-20 at a time). I didn't think it was possible for it to keep the numbering in sync if it had to process the data more than in one go.
If this is possible, I'm totally interested.
from citeproc-js.
FWIW, this is how I'm doing it right now:
/**
* Removes outer HTML formatting served from citeproc, sparing inner `<i>` or `<a>` tags.
* @param {string} ref The reference payload from citeproc.
* @return {string} A formatted reference string without outer HTML.
*/
trimHTML(ref: string): string {
return ref
.replace(/<(?!(i|\/i|a|\/a)).+?>/g, '')
.trim()
.replace(/^\d+\.\s?/, '');
}
from citeproc-js.
Related Issues (20)
- Localizing commas, colons, and semicolons HOT 2
- Always capitalize last word in subtitle HOT 1
- [notice] Next.js 13.3.1 fails to build citeproc (npm) 2.4.63 HOT 3
- Author names of translated books from English to Japanese are displayed in family name - given name order when the language is set to "ja"
- When the Chinese references are sorted by the hanyu pinyin of the author's name, there is a wrong alignment. HOT 1
- Why processCitationCluster silently exclude citation passed through citationPre or citationPost HOT 1
- Default rendering for contributor name in Katakana and Romanesque for a Japanese entry
- Italics aren't applied for second instance in field if "and" is present HOT 2
- "id." isn't capitalized when first word in citation sentence HOT 5
- Citation Key blocks following fields in note HOT 13
- Delimiting comma wrongly appearing outside quotation mark. HOT 3
- Suffix comma wrongly appearing outside quotation mark
- Valid URLs are having the straight apostrophes transformed into fancy/curly quotes
- TypeError: Cannot read properties of undefined (reading 'strings') HOT 3
- Text in edition field
- first-reference-note-number should consider containers
- Inappropriate hyphen conversion in `number` HOT 6
- Support proper ranking for polyphonic (Chinese) characters
- Quotes in URL field are not escaped and produce invalid HTML output HOT 2
- Bibliography `entry-spacing` attribute not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from citeproc-js.