Coder Social home page Coder Social logo

Comments (8)

gettalong avatar gettalong commented on July 26, 2024 1

@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.

doktorbro avatar doktorbro commented on July 26, 2024

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.

gettalong avatar gettalong commented on July 26, 2024

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.

doktorbro avatar doktorbro commented on July 26, 2024

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.

gettalong avatar gettalong commented on July 26, 2024

Maybe, patches are welcome!

from kramdown.

doktorbro avatar doktorbro commented on July 26, 2024

Sorry, I don’t know ruby.

from kramdown.

kslstn avatar kslstn commented on July 26, 2024

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.

doktorbro avatar doktorbro commented on July 26, 2024

@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

  1. do not use the real strong tag in your text;
  2. do not use nested quote tags;
  3. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.