Hanging punctuation via custom css?

kidwellj's Avatar


17 Feb, 2015 09:07 PM

Before I dive in too deeply into creating a custom stylesheet, I thought I'd post the question and see if anyone already has experience setting MMD syntax and punctuation as hanging in MMD composer. Specifically, I'd like to typographically hang any non-alphanumeric characters (i.e. punctuation and MMD syntax like #) in the l.h. gutter, which I believe is what the relatively new "hanging-punctuation:" css property is supposed to handle. Ideally, I'd like to have any punctuation which appears at the start of a line to hang in the margin, leaving a straight vertical line of text down the left hand side. Done properly, I think this should also include glyphs on letters (i.e. the top cross on a "t"), but I understand this might be a bit ambitious. Has anyone set these properties for their theme? I've noticed a lot of iPad MD editors do this and was surprised to find it wasn't there for MMD composer. Any help is most appreciated!

  1. Support Staff 1 Posted by Fletcher on 17 Feb, 2015 09:14 PM

    Fletcher's Avatar

    You're writing about two different things.

    CSS is used on HTML, not on text editors (unless the text editor is
    built using an editable HTML view).

    Composer stylesheets (officially called "themes" starting in MMDC v 3
    for disambiguation) are not CSS. So this doesn't work. CSS is only
    applied to the preview, not the editor.

    I get that some people like screwing up perfectly good margins by moving
    text into them, but I'm not a fan of this. :)

    Composer does not support "hanging punctuation" at this time.


  2. 2 Posted by kidwellj on 17 Feb, 2015 09:18 PM

    kidwellj's Avatar

    Thanks for this very quick response! And thanks for setting me straight on composer stylesheets - I was definitely getting my css together for that purpose which would have been a fruitless pursuit.

    I'm surprised to hear that you're more concerned about the typographical hygiene of margins over text body - I think it has been standard typographical practice to hang punctuation for newspapers, magazines, and books for quite a long time now, particularly because it allows the eye to lead down the page more accurately towards the text that it is processing. With that said, I'm a big fan of composer overall and am happy to defer to the developer's preferences. Just consider this a permanent vote for this feature to be added to a theme when that becomes possible... :)

  3. Support Staff 3 Posted by Fletcher on 19 Feb, 2015 01:21 AM

    Fletcher's Avatar

    I experimented with this because I was intrigued by the challenge (not because I think it's a good idea... ;)

    An NSTextview is apparently not allowed to put any text outside of the text container (outside the margin). So to do this, one has to set a "fake" margin inside the actual margin. Obviously it's possible, but it will require some other adjustments to make printing work properly, auto zoom, etc. Plus, it really looks funny when a header has a background box, and the header lines are all different lengths (since ### has to be outdented further than #).

    For the moment any way, I'm not going to implement this.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac