Comments (8)
@kslstn Yes, there is no algorithm in kramdown to detect correct pairs of quotes. If you don't want quotes turned into smart quotes automatically, use the smart_quotes
option.
You either need to pre-process your source files and insert <q>
tags there or post-process the output of kramdown.
from kramdown.
I forget to mention the direct way to design the quotes with CSS:
q { quotes: "\201C" "\201D" "\2018" "\2019" }
This syntax looks similar to the smart_quotes
option, so I presume you know about it.
from kramdown.
The problem is that currently quotation marks are not recognized in pairs. I.e. kramdown doesn't know when a quotation starts and when it ends. It just sees a straight quotation mark, does some checking and changes the quotation mark into the one it assumes is the correct one. Therefore it is not possible to utilize the <q>
tag.
from kramdown.
I don’t see any difference between handling a pair of asterisks and a pair of quotation marks. If you apply the proven asterisk-to-emphasis-algorithm to the quotation mark, it should work like a charm.
from kramdown.
Maybe, patches are welcome!
from kramdown.
Sorry, I don’t know ruby.
from kramdown.
The problem is that currently quotation marks are not recognized in pairs. I.e. kramdown doesn't know when a quotation starts and when it ends. It just sees a straight quotation mark, does some checking and changes the quotation mark into the one it assumes is the correct one. Therefore it is not possible to utilize the
<q>
tag.
Is this still the case today? I (wrongly) submitted this issue to the Jekyll project. Having <q>
tags would let site makers define quotation marks in CSS, based on the language of the text in which the quote appears. Because of how Jekyll and Kramdown work together, right now, there's no way to consistently apply smart quotation marks for more than one language on a site.
from kramdown.
@kslstn the irony is most developers don’t understand the importance of proper typography. for example jnvsor/jnvsor.github.io#1
there is one very simple workaround without extra-processing mentioned by @gettalong: abuse the strong tag. it’s applicable if you
- do not use the real strong tag in your text;
- do not use nested quote tags;
- do not care about html semantics.
example
input markdown
bob: **where are you, alice?**
alice: **i’m on the *titanic*.**
input css
strong { font-weight: normal }
strong:before { content: "«" }
strong:after { content: "»" }
output
bob: «where are you, alice?»
alice: «i’m on the titanic.»
from kramdown.
Related Issues (20)
- Fenced codeblocks column (not the list indentation) should determine the stripped whitespace from the code HOT 3
- handling `br` inside formatting tags HOT 2
- [feature] support inline notes
- Attribute name consisting of colon does not get parsed HOT 1
- Code block language not parsing in details/summary following math expression HOT 2
- Custom Parser Support HOT 1
- MD to HTML is adding spaces to code segments. HOT 4
- Add an extension for parsing Mermaid syntax to the libraries extending the functionality of kramdown HOT 1
- Could not find gem 'kramdown' in https://github.com/gettalong/kramdown.git HOT 5
- Pipe characters within a inline link is parsed as a table (rather than a link) HOT 1
- `markdown="0"` meaning HOT 1
- Select whether an HTML tag is parsed as block or span level HOT 2
- `time` should be span level by default HOT 1
- Void elements should not use trailing slashes. HOT 2
- Jekyll kramdown: How to disable generating styles in tables? HOT 1
- Rouge CSS not applied to code HOT 2
- Japanese chars combined with MD syntax are not converted HOT 5
- Can I remove the image parsing method? HOT 2
- parse failure on empty tables
- Odd behavior with nested table and mixing block and inline elements HOT 1
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 kramdown.