I'm trying to add a formatted json object as a code block inside a table cell and BitBucket just won't render the markdown correctly, but my VSCode render looks just fine. What is the proper syntax for BitBucket?
My markdown looks like this:
| Message ID | Description | Format |
|:---:|:--- |:--- |
| **4** | Regular data transmission | <pre lang=json>{<br> "message_id": 4, <br> "cellular_imei": 123456789012345,<br> "iridium_imei": 123456789012345,<br> "device_logged_time": "2020-05-13 06:36:05"<br> "payload": {<br> "conductor_current_avg": "",<br> "conductor_current_rms": "",<br> "rssi_level": "",<br> "board_temperature": "",<br> "x_tilt": "",<br> "y_tilt": "",<br> "storage_capacitor_voltage": "",<br> "rangefinder_height": "",<br> "conductor_temperature": "",<br> "ground_temperature": ""<br> }<br>}</pre> |
Should render as
But is instead rendered as plaintext.
@Soumyadeep MandalThanks for the reply. Unfortunately the first link you shared does not have an answer. It appears to be the same issue, but without a clear answer or indication that BitBucket will ever support HTML elements inside code blocks. The second link is a generic documentation of how to use different markdown styles, but again does not answer my question.
The issue here is that BitBucket claims to support the CommonMark Spec found at https://spec.commonmark.org/0.29/ but they haven't updated their documentation on how to implement escaping HTML elements. Their documentation references using "safe_mode" which was deprecated years ago when they were supporting python 2.x.
The reason I have to use HTML elements inside the code block is to "prettify" the json object for readability. I could alternatively write the entire thing as a single line code block, but that would lose a lot of value in clean documentation.
My markdown renders perfectly in GitHub but fails in BitBucket. At this rate I will be moving all of my versioned code to GitHub and paying for their service instead of supporting BitBucket.
I'd love to be proven wrong on why this doesn't render as it should, but as it stands, BitBucket has failed to deliver.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.