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

fix: Style tag must be a block element #70

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

Omikhleia
Copy link
Contributor

@Omikhleia Omikhleia commented May 8, 2024

Closes #64

Test script

local lunamark = require("lunamark")
local opts = { notes = true }
local writer = lunamark.writer.html.new(opts)
local parse = lunamark.reader.markdown.new(writer, opts)
local result, matadata = parse([[

<style>
.blue20 {
    color: blue;
    font-size: 20px;
}
.red::before {
    color: red;
    content: '_TODO_';
}
</style>

]])

print(result)

Before

<p><style> .blue20 { color: blue; font-size: 20px; } .red::before { color: red; content: &#39;<em>TODO</em>&#39;; } </style></p>

(Lines are not honored, and content is interpreted as Markdown, with escapes &#39; and <em> tags...)

After

<style>
.blue20 {
    color: blue;
    font-size: 20px;
}
.red::before {
    color: red;
    content: '_TODO_';
}
</style>

(As in original input, unaltered)

@Witiko Witiko merged commit 5d9e405 into jgm:master May 9, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

inline <style> element results in parse error
2 participants