I want to replace the " character in the following raw text.
#raw(
"print("Hello World!")",
lang: "python"
)
The output will be
#raw(
"print(\"Hello World!\")",
lang: "python"
)
Thank you for your support.
I want to replace the " character in the following raw text.
#raw(
"print("Hello World!")",
lang: "python"
)
The output will be
#raw(
"print(\"Hello World!\")",
lang: "python"
)
Thank you for your support.
Replace how? There is str.replace.
To escape double quote, use backslash: https://typst.app/docs/reference/foundations/str/#escapes.
Suggestion: use the raw syntax, either one of these.
Inline raw:
```python print("Hello World!")```
Block raw:
```python
print("Hello World!")
```
If you want to replace any characters in the above, you can write them out literally in the raw part.
Thank you for your feedback.
Thank your for your feedback. I am doing it manually.
It’s not quite clear to me what you want to achieve. You want to replace characters in the source text, am I reading the question correctly? (So it’s about the editor and not typst per se?)
Why though? Is there anything that you need to do, that does not work with using the raw syntax? Without you telling us what that thing is, we can’t help you further.
The easiest way to avoid having to escape quotes is using raw syntax – especially when you want to have raw code anyway.