Marked handling of block quotes

Mathew's Avatar

Mathew

25 Dec, 2011 11:59 AM

I just noticed that blockquotes (and perhaps other HTML) does not get converted from Markdown to HTML in the way I expected.

When I do something like this:

the great quote

It gets converted to:

the great quote

What I want (and expected) is:

the great quote

Is this a bug? Or is there an option so I don't get the extra

tags nested within blockquotes?

  1. 1 Posted by Mathew on 25 Dec, 2011 12:01 PM

    Mathew's Avatar

    Yikes, did the above wrong.

    Mainly the problem is paragraph tags get inserted inside of the blockquote tags. Is there some way to make this NOT happen?

  2. Support Staff 2 Posted by Brett on 25 Dec, 2011 01:03 PM

    Brett's Avatar

    Hey Mathew,

    This isn't a Marked issue, it's the way MultiMarkdown renders blockquotes. That being said, it's perfectly semantic and the standard way of displaying blockquotes. Why do you want to change the parser?

    -Brett

  3. 3 Posted by Mathew Mitchell on 25 Dec, 2011 01:09 PM

    Mathew Mitchell's Avatar

    Hmm. Here's what happens. I have CSS for both paragraphs and blockquotes.

    When using the <blockquote><p>content</p></blockquote> approach my
    quotes get formatted like paragraphs in terms of font.

    Here's the two CSS defs I'm using:

    blockquote {
        margin-left: 40px;
    width: 75%;
    border-left: 2px solid #666;
    background-color: white;
    padding: 0 0 0 10px;
    margin-bottom: 20px;
    font: 1.1em "Courier New", Courier, mono;
    }

    p {
    font: 1.02em/1.5em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
    margin: 1em 0 1em;
    color: #3d3d3d;
    }

    If I simply use HTML for blockquotes I'm fine.

    I'm far far far from an HTML, CSS, etc. expert. Perhaps I'm doing something wrong?

    Many thanks. Surprised to get a response on Xmas! Hope you're having a great day,

    Mathew

    Mathew Mitchell
    Co-Director, Center for Teaching Excellence
    Professor, Learning & Instruction, School of Education
    University of San Francisco

    email: [email blocked]
    website: socrates.usfca.edu/mitchellm

  4. Support Staff 4 Posted by Brett on 25 Dec, 2011 02:27 PM

    Brett's Avatar

    As long as your markup is consistently giving you `<blockquote><p></p></blockquote>` (there's always a graf inside), then just change your blockquote definition (or at least the font portions of it) to blockquote>p instead of blockquote. That will apply your fonts and such to the paragraph inside of the blockquote, overriding the specificity of the normal p definition.

    I would suggest doing it like this:

    blockquote {
        margin-left: 40px;
    width: 75%;
    border-left: 2px solid #666;
    background-color: white;
    padding: 0 0 0 10px;
    margin-bottom: 20px;
    font: 1.1em "Courier New", Courier, mono;
    }

    blockquote>p {
    font: 1.1em "Courier New", Courier, mono;
    }

    Note that I left the font definition in the blockquote tag, too, to cover any other markup that might be there instead. The only issue you may run into is that now you have nested em sizes that may cause unexpected font size results. You could clear the whole issue up by using px instead of em on your font size definitions. I don't know what scale everything else is at, but I think you could probably get away with setting 14px on both blockquote/blockquote>p definitions and have more consistent results:

    font: 14px "Courier New", Courier, mono;

    -Brett

  5. 5 Posted by Mathew Mitchell on 25 Dec, 2011 03:13 PM

    Mathew Mitchell's Avatar

    Perfecto! Thanks so much.

    Did not know about the blockquote>p approach.
    Very nice.

    - Mathew

    Mathew Mitchell
    Co-Director, Center for Teaching Excellence
    Professor, Learning & Instruction, School of Education
    University of San Francisco

    email: [email blocked]
    website: socrates.usfca.edu/mitchellm

  6. Brett closed this discussion on 26 Dec, 2011 12:31 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? 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