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

commentRegex renders error when multiple lines #1114

Open
qrzbing opened this issue May 2, 2024 · 4 comments · May be fixed by #1496
Open

commentRegex renders error when multiple lines #1114

qrzbing opened this issue May 2, 2024 · 4 comments · May be fixed by #1496
Labels
bug Something isn't working

Comments

@qrzbing
Copy link

qrzbing commented May 2, 2024

Describe the bug
%% is used as comment chars in Obsidian, and in code blocks with multiline %%, quartz renders error.

To Reproduce
Steps to reproduce the behavior:

Make a code module:

%%MIDI program 0
%%barnumbers 0

After npx build, page will be renderred error.

Expected behavior

show

%%MIDI program 0
%%barnumbers 0

Screenshots and Source

image

Desktop (please complete the following information):

  • Quartz Version: latest git version
  • OS: Windows 11
  • Browser: Chrome
@qrzbing qrzbing added the bug Something isn't working label May 2, 2024
@qrzbing qrzbing changed the title commentRegex need to be restricted only in text commentRegex renders error when multiple lines May 2, 2024
@LesleyLai
Copy link

I hit the same situation with the following code block (unfortunately, R uses %% as modulo operator):

is_leap_year <- function(year) {
  if (year %% 400 == 0) {
    return(TRUE)
  }

  if (year %% 100 == 0) {
    return(FALSE)
  }

  if (year %% 4 == 0) {
    return(TRUE)
  }

  FALSE
}

@exodrifter
Copy link

exodrifter commented Oct 12, 2024

I ran into this issue, but with inline code as well:

Markdown:

You can comment out parts of a document by surrounding the text to comment out with `%%`. For example:

```markdown
This sentence is missing a %%word%% in read mode.

%%
This only appears in edit mode.
%%
```

This results in:

> This sentence is missing a %%word%% in read mode.
>
> %%
> This only appears in edit mode.
> %%

Obsidian:

image

Quartz:

image

@aarnphm
Copy link
Collaborator

aarnphm commented Oct 16, 2024

not a bug, TIL.

cc @saberzero1 :/

@saberzero1
Copy link
Collaborator

not a bug, TIL.

cc @saberzero1 :/

Another one for the parser rework.

@saberzero1 saberzero1 linked a pull request Oct 16, 2024 that will close this issue
24 tasks
saberzero1 added a commit to saberzero1/quartz that referenced this issue Oct 31, 2024
saberzero1 added a commit to saberzero1/quartz that referenced this issue Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants