comments in code showing as heading styles after the first one

timothy.c.bates's Avatar

timothy.c.bates

30 May, 2012 10:52 AM

Typed in the following, getting the view attached. Comments are being interpreted as markdown headings, or a mixture of R code and md heading... Note the first one looks OK, but this doesn't always obtain.

```R
# this package depends on R >= 2.14.1
# you may also need to update your packages:
# options(repos = c(CRAN = 'http://cran.r-project.org'))
# update.packages()
library(devtools); install_github('knitr', 'yihui')
```

  1. Support Staff 1 Posted by Brett on 30 May, 2012 11:01 AM

    Brett's Avatar

    Do you have "fenced code blocks" enabled in Behavior preferences?

  2. 2 Posted by timothy.c.bates on 30 May, 2012 11:21 AM

    timothy.c.bates's Avatar

    yes Convert fenced code blocks is ticked

  3. Support Staff 3 Posted by Brett on 30 May, 2012 01:27 PM

    Brett's Avatar

    Your text, copied straight from this page, in Marked 1.4 with Fenced code blocks checked: http://ckyp.us/IUe1

    Are there any spaces before your backticks?

  4. 4 Posted by timothy.c.bates on 30 May, 2012 02:01 PM

    timothy.c.bates's Avatar

    The attached doc is rendering badly for me.
    It came out of the production system looking ok (knitr pacakge in R), but when I edit the comments (in Textmate 2) it gets the mixed markdown/R look...

    here's how it looks in Marked Version 1.4 (221)

    http://d.pr/i/3zF1

  5. Support Staff 5 Posted by Brett on 30 May, 2012 02:09 PM

    Brett's Avatar

    This is what I get on 1.4 (221): http://ckyp.us/1v2G

    Are you using a custom processor?

  6. Support Staff 6 Posted by Brett on 30 May, 2012 02:10 PM

    Brett's Avatar

    Oh, the issue might be the inserted markup for the edit point. Edit something at the bottom of the file and save, let me know if it goes back to normal for you.

  7. 7 Posted by timothy.c.bates on 30 May, 2012 02:41 PM

    timothy.c.bates's Avatar

    no spaces, no custom processor

    edited at the bottom, problem remains above (i.e., http://d.pr/i/4smi)

    behavior settings http://d.pr/i/1Zxi
    style settings http://d.pr/i/B2YY

  8. 8 Posted by timothy.c.bates on 30 May, 2012 02:43 PM

    timothy.c.bates's Avatar

    this is also odd: when the ticks start the document, it is rendering with "re markdown="0"> at the top

    http://d.pr/i/iffb

  9. Support Staff 9 Posted by Brett on 30 May, 2012 02:53 PM

    Brett's Avatar

    Try turning off "Process HTML files" in Behavior, let me know if that changes anything.

  10. 10 Posted by timothy.c.bates on 30 May, 2012 02:57 PM

    timothy.c.bates's Avatar

    boom: that was the solution. but it shouldn't be, should it?

    t

  11. 11 Posted by timothy.c.bates on 30 May, 2012 02:59 PM

    timothy.c.bates's Avatar

    and still getting this weird behaviour when ``` is line 1

    http://d.pr/i/MWdM

  12. Support Staff 12 Posted by Brett on 30 May, 2012 03:11 PM

    Brett's Avatar

    That I can fix for the next version. Marked inserts some code to assist the processor with certain features, and that's being broken by something. I can replicate it and will work that out. If you edit at the bottom now (outside of the code block), though, you should see correct results, right?

  13. 13 Posted by timothy.c.bates on 30 May, 2012 05:17 PM

    timothy.c.bates's Avatar

    yes, touching lines at the bottom corrects the result for the document

    thanks Brett!

  14. Brett closed this discussion on 07 Jun, 2012 01:46 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