markdown documents contains " " or " "

Jeffrey's Avatar

Jeffrey

Mar 27, 2015 @ 08:44 AM

If a markdown documents contains " " or " ", the documents will be displayed differently between html and paginated pdf in version 2.4.11. Could you guys fix this? Thanks.

  1. Support Staff 1 Posted by Brett on Mar 27, 2015 @ 01:08 PM

    Brett's Avatar

    Could you describe what you mean by "different?" The output appears
    identical to me.

    -Brett

  2. 2 Posted by Jeffrey Wu on Mar 27, 2015 @ 03:21 PM

    Jeffrey Wu's Avatar

    Hi Brett,

    Thanks for your reply.

    I just figure out " " is displayed right, but maybe the blockquote is
    not.

    I just tried to use markdown to write resume and your brilliant Marked2 to
    export to paginated pdf. You can find the different of the distance between
    the date in the left side and the paragraphs in the the right side in the
    following picture. (I used a costumed css which is attached for your
    reference)

    Thanks,
    Jeffrey​

  3. Support Staff 3 Posted by Brett on Mar 27, 2015 @ 04:49 PM

    Brett's Avatar

    That's an interesting bug, and at the moment I'm unable to track down what's causing that. I would suggest, however, that the more manageable and readable way to handle this would be to choose a specific header level for these dividing lines and put a standard Markdown element, such as bold or emphasis, into the line around the portion that needs space. Then you can get precise control with CSS while maintaining a more readable Markdown document.

    If the markup were:

    #### 2000/09 - 2008/12 __HR Manager__
    > Report to:    
    > Subordinate
    

    You could use the CSS:

    h4 {
      font-size: 1em;
      margin: 0;
      font-weight: 700;
    }
    h4 > strong {
      margin-left: 20px;
      font-weight: 700;
    }
    

    That would make the h4 the same font size as the other text, and the bold the same weight so it's indistinguishable visually. Then you can use either margin or padding to move it to the position you want.

    If the prefix (the date) on the line is of variable width, you could also surround that portion with emphasis, e.g. #### _2000/09 - 2008/12_ __HR Manager__, and be able to control its width and margin separately as well. That also opens up the option of using h4 {position: relative} and h4>bold { position: absolute; left: 125px } to ensure consistent positioning.

    Let me know if that helps. I'll take a deeper look into why Marked is losing the hardcoded spacing.

  4. 4 Posted by Jeffrey Wu on Mar 31, 2015 @ 04:17 PM

    Jeffrey Wu's Avatar

    HI Brett,

    Very appreciate your kind help and thanks again for your amazing marked 2
    app.

    Jeffrey

    Best Regards,

    Jeffrey WU

    Account Manager | Milestone Talent Associates

    021-5168 8220 ext. 280 | 021-6199-9280 | 139-1821-5136

    13/F, China Merchants Tower, No.161 Lujiazui Road (E), Shanghai 200120,
    China

    www.milestonetalent.com

Reply to this discussion

Internal reply

        Formatting help / Preview (switch to plain text)

          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

              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