-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
OFM: Quartz does not display checkboxes for the '[?]' format #1407
Comments
This is not a valid usage afaik You can try it on GitHub markdown. |
https://quartz.jzhao.xyz/features/Obsidian-compatibility |
I don't think
|
this is obsidian markdown but its def weird lol |
oh ok I have never used it but sure lmao |
I added my own custom checkboxes by doing the following:
li:has(> * > span.custom-checkbox),
li:has(> span.custom-checkbox) {
list-style-type: none;
margin-left: -1.5rem;
}
// Add the following to the Options interface:
export interface Options {
// ... stuff goes here ...
customCheckboxes: boolean
customCheckboxMappings: Record<string, string>
}
//add the following to the defaults:
const defaultOptions: Options = {
// ... stuff goes here ...
customCheckboxes: true,
customCheckboxMappings: {
"-": "⛔️",
">": "🫸",
"<": "🗓️",
"p": "👍",
"c": "👎",
"w": "😱",
"!": "🤯",
"f": "🔥",
"s": "⭐️",
"m": "💰",
}
}
// Add the following RegEx beneath the other regex definitions:
const customCheckboxRegex = /^(\s*)- \[(-|f|w|!|>|<|p|c|s|m)\]\s*(.*)$/gm
// Add the following as part of the `textTransform()` body
if (opts.customCheckboxes) {
if (src instanceof Buffer) {
src = src.toString()
}
src = src.replace(customCheckboxRegex, (match, spaces, checkType, text) => {
return "\n" + "\t".repeat((spaces?.length || 0) / 4) + "- <span class='custom-checkbox'>" + (opts.customCheckboxMappings[checkType] || match) + " " + text + "</span>"
})
} While this does not include the |
Thanks for this, I'll keep it in mind with the parser rework. |
Describe the bug
ObsidianFlavoredMarkdown: Quartz does not display checkboxes for the '[?]' format
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It was expected that a checkbox would be displayed.
Screenshots and Source
You can help speed up fixing the problem by either
Desktop (please complete the following information):
node
Version: 22.8.0The text was updated successfully, but these errors were encountered: