Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to replace specific <span> like actually with <abbr>? #331

Open
BarbzYHOOL opened this issue May 13, 2020 · 2 comments
Open

How to replace specific <span> like actually with <abbr>? #331

BarbzYHOOL opened this issue May 13, 2020 · 2 comments

Comments

@BarbzYHOOL
Copy link

BarbzYHOOL commented May 13, 2020

I'd like to explain some words, but they are not abbreviations, so it's wrong to explain these words with <abbr title="">

I just would like to reproduce the system of abbrs but with some changes and only to certain <span>, any idea how to proceed?

I read the code a bit but it looked very confusing, with meaningless names etc

note: posted here first jonlabelle/ci-markdown#14

@michelf
Copy link
Owner

michelf commented May 13, 2020

I'm not sure exactly what would suit your needs, but here's a few hints in case you want to tweak the code.

Abbreviations are handled in two phases. First it reads and remove abbreviation definitions from the Markdown source in stripAbbreviations and the callback function that follows. Then it searches for abbreviations in the text in doAbbreviations and replaces occurrences in the callback function that follows.

@BarbzYHOOL
Copy link
Author

(my bad, i edited the first message, some html had been lost in xss filtering)

What I meant was to write a list of words, then when it's transformed into html, it automatically adds <span title="definition">word</span>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants