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

[Question] Code Block Settings #79

Closed
AlexHedley opened this issue Dec 27, 2024 · 3 comments
Closed

[Question] Code Block Settings #79

AlexHedley opened this issue Dec 27, 2024 · 3 comments
Labels
Question Question about this project Triage Issue needs to be triaged

Comments

@AlexHedley
Copy link
Contributor

When including the code block toolbar item </> is there a way to turn on the syntax highlighting?

<span class="ql-formats">
    <button class="ql-code-block"></button>
</span>

modules: { syntax: true }

<script>
const quill = new Quill('#editor', {
  modules: {
    syntax: true,              // Include syntax module
    toolbar: [['code-block']]  // Include button in toolbar
  },
  theme: 'snow'
});
...
</script>
@AlexHedley AlexHedley added Question Question about this project Triage Issue needs to be triaged labels Dec 27, 2024
@ADefWebserver
Copy link
Collaborator

I would consider a PR for this if it can be done without making a breaking change.

@AlexHedley
Copy link
Contributor Author

@ADefWebserver I've created a new PR #80 to add this functionality. The default is false so shouldn't break existing versions. Have added examples of both in the samples.

@ADefWebserver
Copy link
Collaborator

Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Question about this project Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants