Git Product home page Git Product logo

Comments (4)

jrblevin avatar jrblevin commented on July 21, 2024

I think the new markdown-collect-fm-code-blocks function introduced in #40 could be used for font lock to fix this issue also. By identifying fenced code blocks first, then identifying headings that are not already marked as code blocks. I'll try to take a look soon, but if anyone can get to it sooner please submit a pull request.

from markdown-mode.

syohex avatar syohex commented on July 21, 2024

In outline-next-visible-heading, outline-mode uses only regular expression(outline-regexp) for searching header. We can control its behaviour only by outline-regexp. So we need to write wrapper command for avoiding this issue as below.

(defun markdown-move-visible-header-common (move-fn arg)
  (let ((blocks (markdown-collect-gfm-code-blocks)))
    (funcall move-fn arg)
    (while (markdown-gfm-code-block-p blocks (point))
      (funcall move-fn arg))))

(defun markdown-next-visible-heading (arg)
  (interactive "p")
  (markdown-move-visible-header-common #'outline-next-visible-heading arg))

(defun markdown-next-visible-heading (arg)
  (interactive "p")
  (markdown-move-visible-header-common #'outline-previous-visible-heading arg))

I don't understand outline-forward-same-level behavior yet :-(

from markdown-mode.

syohex avatar syohex commented on July 21, 2024

I sent PR #41. Please check it.

from markdown-mode.

jrblevin avatar jrblevin commented on July 21, 2024

Thanks for this report, @duncanburke, and thanks @syohex for the patch. As I mentioned in #41 I have been working on syntax table support for code blocks. In addition to helping with font lock, this is also related to the heading movement commands. I used #41 as a basis for the changes. So, this should be fixed in 5daa9fc.

from markdown-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.