Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative markdown-css-paths #855

Closed
mattiasb opened this issue Nov 16, 2024 · 0 comments
Closed

Relative markdown-css-paths #855

mattiasb opened this issue Nov 16, 2024 · 0 comments

Comments

@mattiasb
Copy link
Contributor

mattiasb commented Nov 16, 2024

Expected Behavior

Since #835 got merged I can now set markdown-css-paths as a file
local variable like this:

<!-- -*- markdown-css-paths: ("/home/mattiasb/Code/github.com/mattiasb/repository/stylesheet.css"); -*- -->

It would be nice to be able to let the path be relative instead like
this:

<!-- -*- markdown-css-paths: ("./stylesheet.css"); -*- -->

… and it would resolve the path to the style sheet relative to the
markdown file.

Actual Behavior

When I run markdown-preview the HTML is written to a file like
file:///tmp/burl7ynLE7.html and thus "./stylesheet.css" can't
be found.

Steps to Reproduce

With test.md:

<!-- -*- markdown-css-paths: ("./stylesheet.css"); -*- -->

# Test

Test!

… and stylesheet.css like:

h1 { color: red; }

… both in the same directory then:

  1. Do M-x normal-mode to make sure the local variable is loaded.
  2. Press y to allow the file local variable.
    See: Mark markdown-css-paths safe as a file local var #856.
  3. In test.md do C-c C-c p
  4. Notice how the header isn't red.

Software Versions

  • Markdown Mode: 2.7-alpha
    • ;; Package-Version: 20241107.349
    • ;; Package-Revision: 6f59f72ca040
  • Emacs: 29.4
  • OS: Fedora Workstation 41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants