Git Product home page Git Product logo

Comments (12)

syohex avatar syohex commented on June 23, 2024

I'll check later

from markdown-mode.

jrblevin avatar jrblevin commented on June 23, 2024

The documentation is unclear; sorry about that. The custom variable you mentioned only affects the insertion commands, not font lock.

from markdown-mode.

jrblevin avatar jrblevin commented on June 23, 2024

Sorry for my brevity earlier. I was typing from my phone. In case it wasn't clear, what markdown-italic-underscore does is control which symbols (_ or *) are used when markdown-insert-italic (C-c C-s e) is called. I have updated the documentation on this point (see fc1204b).

I'd like to use plain markdown-mode (not gfm-mode) and still be able to write notes with variable names (with underscores) in them.

I am with you here. What I do is either use backticks, like foo_bar_zot, or escape the underscores (which is ugly, but works when I process the file with Markdown), like foo\_bar\_zot. The underlying problem is that most Markdown processors (aside from GFM, of course) don't permit underscores in words and so markdown-mode needs to match that as closely as possible.

If you haven't lately, you might also want to give gfm-mode another try. At this point there isn't much difference between them aside from the underscore behavior and support for strikethrough text in gfm-mode. It no longer turns on visual-line-mode automatically.

from markdown-mode.

hmelman avatar hmelman commented on June 23, 2024

Thanks, that makes sense about markdown-italic-underscore. I'm not sure about many other processors, I'll note that in Marked 2 neither of the two sample lines show any italics. I'll give gfm-mode another try.

from markdown-mode.

jrblevin avatar jrblevin commented on June 23, 2024

Marked 2 uses MultiMarkdown by default and indeed, on my system it does not generate italics with your examples. On the other hand, Markdown.pl does...

from markdown-mode.

hmelman avatar hmelman commented on June 23, 2024

Just seems way more natural to me that _ imbedded in a word shouldn't trigger italics. How often does anyone want part of a word emphasized? If they did, they could always use html. And I'd suspect that a high percentage of Emacs users might be programmers who write about variable or function names. Just my $0.02.

I tried with Common Mark and they don't italicize either of the examples either.

from markdown-mode.

jrblevin avatar jrblevin commented on June 23, 2024

Yes, it is an unfortunate incompatibility across implementations. I can see both sides, though. Like most programmers, I usually want the GFM-like underscore behavior, but I think writers, etc. would tend to prefer the Markdown.pl behavior. In any case, for now we have one mode for each behavior (markdown-mode and gfm-mode). In the future I could see a unified markdown-mode with settings for each variation and extension, as well as predefined groups of settings for specific processors (Pandoc, MultiMarkdown, CommonMark, etc.). For now, the target for markdown-mode is Markdown.pl plus some common, unobtrusive extensions that are unlikely to have adverse interactions.

from markdown-mode.

vyp avatar vyp commented on June 23, 2024

In the future I could see a unified markdown-mode with settings for each variation and extension, as well as predefined groups of settings for specific processors (Pandoc, MultiMarkdown, CommonMark, etc.

I've been meaning to work on this myself. I'm glad to see I'm not the only one thinking about it!

from markdown-mode.

cosmicexplorer avatar cosmicexplorer commented on June 23, 2024

The issue here seems very similar to the reason #81 is still open (and #13, even); markdown-mode currently has a single unified syntax / command set for all markdown dialects at once, and they do end up conflicting very rarely (but they do, which is why these issues are still up). In #91 I added support for pandoc metadata sections with a defcustom, which allows the user to customize the default, while allowing for overriding with directory/file-local variables.

I think a better approach would just be to define derived modes for each dialect, similar to the way gfm-mode already exists, specialize each command to each dialect as appropriate, and also allow customizing markdown-command depending upon the dialect. I'd be interested in working on this over the next month or so if you think that sounds like a good approach. I can make an issue which will keep a running tally of the differences between dialects that we do and don't support yet. The only concern I can see is how keybindings might work for things like inline footnotes (#81) which are supported in one dialect but not another; I think the best thing to do is probably just have a case-by-case choice of similar but non-conflicting keybindings for operations like that.

from markdown-mode.

jrblevin avatar jrblevin commented on June 23, 2024

I'd favor a dual approach of first adding individual feature flags to markdown-mode as new features are supported. This is what I had in mind when I implemented the basic LaTeX/itex math support (see markdown-enable-math), which I use in my toolchain¹ but also happens to be supported by some Markdown processors. Things that are not likely to conflict can be enabled by default. Things that are very likely to cause conflicts (like math support, with bare dollar signs as delimiters) can be toggled as needed (even automatically with file-local variables).

When enough features of some processor are supported we could add a derived mode to enable/disable groups of features at once. My worry is that adding a named derived mode (e.g., pandoc-mode) will be seen as an implicit guarantee or goal of fully supporting all features and extensions of that processor. (Besides, in this example there is already a very nice pandoc-mode by Joost Kremers. Maybe there are others as well.)

¹ Currently itex2MML + MultiMarkdown + GNU Source Highlight and some Perl scripts to glue them together.

from markdown-mode.

cosmicexplorer avatar cosmicexplorer commented on June 23, 2024

That makes a lot of sense. Cool. I'll take a look at this next.

from markdown-mode.

jrblevin avatar jrblevin commented on June 23, 2024

I'm closing this since I think the initial issue was resolved and I'm not sure there's anything else that's actionable per se. I think feature sets, derived modes, or some similar framework will be the longer term solution. Any steps in that direction can be added as new PRs.

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.