spacemacs icon indicating copy to clipboard operation
spacemacs copied to clipboard

Markdown mode occasionally fails to highlight links in list

Open quanticle opened this issue 6 years ago • 8 comments

Description :octocat:

Markdown mode fails to highlight certain links in a long list of links.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

  • Note that every so often, the link title is not highlighted and underlined, as seen in this screenshot

Expected behaviour: :heart: :smile:

  • Intended behavior: consistent highlighting for all links

Note that the non-highlighted markdown links have the following text properties:

             position: 939 of 2667 (35%), column: 5
            character: t (displayed as t) (codepoint 116, #o164, #x74)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x74
               script: latin
               syntax: w 	which means: word
             category: .:Base, L:Left-to-right (strong), a:ASCII, l:Latin, r:Roman, u:Lowercase
             to input: type "C-x 8 RET 74" or "C-x 8 RET LATIN SMALL LETTER T"
          buffer code: #x74
            file code: #x74 (encoded by coding system undecided-unix)
              display: by this font (glyph code)
    xft:-IBM -IBM Plex Mono-semibold-normal-normal-*-14-*-*-*-m-0-iso10646-1 (#x17)

Character code properties: customize what to show
  name: LATIN SMALL LETTER T
  general-category: Ll (Letter, Lowercase)
  decomposition: (116) ('t')

There is an overlay here:
 From 934 to 984
  face                 hl-line
  priority             -50
  window               #<window 3 on blogroll.md>


There are text properties here:
  fontified            t
  markdown-list-item  

whereas the highlighted links have the following properties:

             position: 823 of 2667 (31%), column: 5
            character: o (displayed as o) (codepoint 111, #o157, #x6f)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x6F
               script: latin
               syntax: w 	which means: word
             category: .:Base, L:Left-to-right (strong), a:ASCII, l:Latin, r:Roman, u:Lowercase
             to input: type "C-x 8 RET 6f" or "C-x 8 RET LATIN SMALL LETTER O"
          buffer code: #x6F
            file code: #x6F (encoded by coding system undecided-unix)
              display: by this font (glyph code)
    xft:-IBM -IBM Plex Mono-semibold-normal-normal-*-14-*-*-*-m-0-iso10646-1 (#x12)

Character code properties: customize what to show
  name: LATIN SMALL LETTER O
  general-category: Ll (Letter, Lowercase)
  decomposition: (111) ('o')

There is an overlay here:
 From 818 to 863
  face                 hl-line
  priority             -50
  window               #<window 3 on blogroll.md>


There are text properties here:
  face                 markdown-link-face
  font-lock-multiline  t
  fontified            t
  help-echo            "http://www.econlib.org/econlog/"
  keymap               [Show]
  markdown-list-item   [Show]
  mouse-face           markdown-highlight-face

I don't understand why some link elements have markdown-link-face, while others have markdown-list-item. They should all be one or the other, given that they're identical elements.

System Info :computer:

  • OS: gnu/linux
  • Emacs: 26.1
  • Spacemacs: 0.200.13
  • Spacemacs branch: master (rev. c7a103a77)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(html helm emacs-lisp git markdown pandoc python finance theming)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS XWIDGETS LCMS2

quanticle avatar Jan 03 '19 01:01 quanticle

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] avatar Feb 28 '20 03:02 github-actions[bot]

Have the same issue.
After some tests, I found the problem may be caused by package (mmm-mode). Exclude this package can partly solve this problem.

However, the url still have the wrong italic face when there are underline _ within url. image

jiaming-shi avatar Mar 03 '20 03:03 jiaming-shi

Same here, it fails to highlight `` code block. Disabling mmm-mode seems to be a solution.

Adriankhl avatar May 16 '20 14:05 Adriankhl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] avatar Oct 17 '21 11:10 github-actions[bot]

Just following up: I can confirm that add mmm-mode to dotspacemacs/excluded-packages fixes the list highlighting issue. However, I would argue that this isn't a fix so much as it is a workaround, because adding mmm-mode to excluded-packages removes it from all packages, not just markdown-mode.

quanticle avatar Nov 06 '21 04:11 quanticle

Instead of adding markdown to dotspacemacs-configuration-layers, adding

(markdown :packages (not mmm-mode))

will exclude mmm-mode from just the markdown layer. I think this is a sufficiently narrow workaround that we can close the issue.

My one remaining question is, why does the markdown layer even need mmm-mode? I thought it might be for syntax highlighting inside triple-backtick code blocks, but that functionality actually works just fine without mmm-mode. Can we just remove mmm-mode from the markdown layer?

quanticle avatar Nov 08 '21 05:11 quanticle

I personally agree to remove mmm-mode for markdown layer. you can make a PR for others to review.

lebensterben avatar Nov 08 '21 09:11 lebensterben

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] avatar May 01 '24 16:05 github-actions[bot]