How to embed XML in a note?

Is there a way to tell Joplin to ignore markdown in a piece of text?

I want to include some XML code (some sourcecode to pass to WiX Windows Installer toolset) in a Joplin note. Putting it inside the three backticks marking a code fragment doesn’t work.

Here’s an example:



– that mostly vanishes in a Joplin note
(sorry, newbie ignorance … tried to find an answer but obv have not looked in the right place)
I’m using Joplin 1.0.227 (prod, win32) on x64 Windows 10 Pro

Thanks

I just tested in v1.0.216 under Linux with some sample xml from https://www.w3schools.com/xml/xml_examples.asp and it seems to work here.

So either a difference between the actual installations, or something specific to your XML. Can you post your XML somewhere and/or test if the w3-examples work for you?

As the XML is also not visible in your post above, I’d assume that it is rather a problem with the XML and its interpretation in markdown, than a Joplin-specific problem (?).

Yes I’m sure you’re right that it’s an issue with the XML’s interpretation in markdown, not a Joplin-specific issue. Sorry, I didn’t mean to imply blame on Joplin!

I’ll work through the examples in your link and report back.

thanks

Adding spaces to separate angle-brackets from other characters seems to do the trick, like this (which shows OK in the preview pane so hopefully will be visible):

< Upgrade Id="FB825803-0B67-46E7-B481-E4A5774383A6" > < !-- GUID for 64-bit old-MSI app FIX THIS -- >
    < UpgradeVersion OnlyDetect="no" Property="PREV_MSI64_FOUND"  Minimum="0.0.0" / >
< /Upgrade > 

A fenced code block should work...

```xml
<Upgrade Id="FB825803-0B67-46E7-B481-E4A5774383A6"> <!-- GUID for 64-bit old-MSI app FIX THIS -->
    <UpgradeVersion OnlyDetect="no" Property="PREV_MSI64_FOUND"  Minimum="0.0.0" />
</Upgrade>
```

(Ignore the colours in my markdown code, I'm using custom CodeMirror editor css)

2 Likes

MANY Thanks! That’s great.

Does the custom codemirror css go into userstyle.css? If so would you be willling to share it (or have you already done this)?

It looks very useful :slight_smile:

@MisterKelly

It is userchrome.css for styling the Joplin interface and code editor and, yes, I did post it. It was not so much for the colours I chose, but more to save others a bit of time finding out what some of the more commonly changed css element / class names for the new code editor were.

Please be aware that the first four entries will make changes to the Joplin interface. You may wish to omit those...

1 Like

Many thanks for this. I already had most of the interface changes in my userchrome file, courtesy of other entries in the thread. The other one (the titles) was one I hadn't figured out yet, so I happily added that too :slight_smile:
Cheers