Skip to main content

Differing behavior with () vs ##

Completed

Comments

8 comments

  • Fletcher Penney

    What steps do you take to get doubling up of hashes?  I cannot replicate.

    0
  • Maarten
    Cmd-L Foo <CR>
    # Foo #<CR>

    Result: upon hitting second return, nvUltra adds a space and a hash, resulting in:

    # Foo # #

    Running 2021.09.30.13.09, Check updates does not find newer, on Catalina 10.15.7

    0
  • Fletcher Penney

    Can you post a screenshot of your Editing preferences?

    0
  • Maarten

    I had previously (when trying to change this behavior) added ## to the smart pairs, but iirc it didn't change the behavior.

    I'd forgotten when posting this about the "Append '#' to end of headings"-setting. I suppose I could have written this as "I want that to add a '#' only if I didn't already type one." Seeing the two separate setting explains that headings work differently than "smart pairs" do--I'd like them to work more the same, with the exception of which side of the CR the closing symbol goes--with parens, the closing paren is after the newline; you want the closing hash before the newline.

    Also, I noticed this difference depending on presence of a space after the opening symbol. Maybe I misunderstand the mental model; this isn't what I expected.

    Type

    #Foo<CR>

    Get

    #Foo

    Type

    # Foo<CR>

    Get:

    # Foo #

    Type

    (Foo<CR>

    get:

    (Foo
    )

    Type

    ( Foo<CR>

    get:

    ( Foo

     

     

    0
  • Fletcher Penney

    It looks like it's a regression when the Title Case is turned off.  Turn that on and `#` should work properly.  I'll fix.

    0
  • Maarten

    Yes, that helps, thanks.

    It still feels odd that hitting space after an open-paren kills the smart-added closer, but with headings it works the other way around: "# foo" gets you a closer upon CR but "#foo" does not.

    0
  • Fletcher Penney

    `#foo` is not a header.  The space is required for a header to be recognized.  This is one of the very few intentional differences between MultiMarkdown v6 and Markdown.pl, though it is consistent with the behavior of CommonMark (for what that is worth).

     

    (As an aside, smart pairs must be entered in pairs, as the name would suggest.  The single trailing `#` in your preferences doesn't accomplish anything.)

     

     

    0
  • Fletcher Penney

    Fixed for upcoming release.

    0

Please sign in to leave a comment.

Powered by Zendesk