ArkHost/HelixNotes
14
150
Fork
You've already forked HelixNotes
13

Code pasted into note reverts to multiple headers #138

Open
opened 2026年06月18日 17:26:38 +02:00 by operative2503 · 6 comments

When I paste the following code into a note, it displays perfectly fine until I leave the note and come back. At that point the code is broken up into multiple headers assumably because of the # signs.
Here's the code:

> `# Timezone
> TZ=America/New_York
> 
> # Booklore
> PORT=6060
> APP_USER_ID=1000
> APP_GROUP_ID=1000
> 
> # Database
> DB_USER=grimmory
> DB_PASSWORD=secret_password
> MYSQL_DATABASE=booklore
> MYSQL_ROOT_PASSWORD=secret_password
> 
> # MariaDB container IDs
> DB_USER_ID=1000
> DB_GROUP_ID=1000
> 
> # Database connection
> DATABASE_URL=jdbc:mariadb://mariadb:3306/grimmory`

I had to mess around to even get it to display correctly in this Issue, hence the > in front of every line.

When I paste the following code into a note, it displays perfectly fine until I leave the note and come back. At that point the code is broken up into multiple headers assumably because of the # signs. Here's the code: ``` > `# Timezone > TZ=America/New_York > > # Booklore > PORT=6060 > APP_USER_ID=1000 > APP_GROUP_ID=1000 > > # Database > DB_USER=grimmory > DB_PASSWORD=secret_password > MYSQL_DATABASE=booklore > MYSQL_ROOT_PASSWORD=secret_password > > # MariaDB container IDs > DB_USER_ID=1000 > DB_GROUP_ID=1000 > > # Database connection > DATABASE_URL=jdbc:mariadb://mariadb:3306/grimmory` ``` I had to mess around to even get it to display correctly in this Issue, hence the > in front of every line.

Thanks for reporting! This is expected markdown behavior. # at the start of a line is a heading. Wrap your code in a code block(type `` or use the /code` slash command) and it will persist correctly across save/reload. Closing as this isn't a bug, but let me know if you're seeing this inside a code block and I'll reopen.

Thanks for reporting! This is expected markdown behavior. # at the start of a line is a heading. Wrap your code in a code block(type `` or use the /code` slash command) and it will persist correctly across save/reload. Closing as this isn't a bug, but let me know if you're seeing this inside a code block and I'll reopen.

I understand what you are saying. On the other hand, if I select Code Block from the formatting bar at the bottom, I would expect that Helix would insert the necessary wrapper to avoid this from happening. I know that Helix is a markdown-based app, not a WYSIWYG app, but it would be nice if inserting code into a note didn't result in the app tearing my code apart into headers.

I understand what you are saying. On the other hand, if I select Code Block from the formatting bar at the bottom, I would expect that Helix would insert the necessary wrapper to avoid this from happening. I know that Helix is a markdown-based app, not a WYSIWYG app, but it would be nice if inserting code into a note didn't result in the app tearing my code apart into headers.

I just tried pasting it like this in the wysiwyg editor, then came back it just converted it into a codeblock, as I would expect.:

TZ=America/New_York
# Booklore
PORT=6060
APP_USER_ID=1000
APP_GROUP_ID=1000
 
# Database
DB_USER=grimmory
DB_PASSWORD=secret_password
MYSQL_DATABASE=booklore
MYSQL_ROOT_PASSWORD=secret_password
 
# MariaDB container IDs
DB_USER_ID=1000
DB_GROUP_ID=1000
 
# Database connection
DATABASE_URL=jdbc:mariadb://mariadb:3306/grimmory```
![image](/attachments/8a3104cc-d18e-4f24-9578-aa1a78d06c8a)
I just tried pasting it like this in the wysiwyg editor, then came back it just converted it into a codeblock, as I would expect.: ```# Timezone TZ=America/New_York # Booklore PORT=6060 APP_USER_ID=1000 APP_GROUP_ID=1000 # Database DB_USER=grimmory DB_PASSWORD=secret_password MYSQL_DATABASE=booklore MYSQL_ROOT_PASSWORD=secret_password # MariaDB container IDs DB_USER_ID=1000 DB_GROUP_ID=1000 # Database connection DATABASE_URL=jdbc:mariadb://mariadb:3306/grimmory``` ![image](/attachments/8a3104cc-d18e-4f24-9578-aa1a78d06c8a)

Hmmm- for what it's worth, when I start a new note and select code block and then manually type in the entire code block exactly as shown in my original issue (minus all the >'s of course) the code stays intact when leaving the note and coming back.

I'm wondering if it has to do with the fact that I copied the code block out of UpNote and pasted it into Helix, and something in the formatting from UpNote screws everything up.

As a test, I searched online for "Grimmory .env file" and copy-pasted the code from the AI results from Brave Search and they too stayed intact. Really thinking this must be an UpNote to Helix issue, not an issue with Helix itself.

Hmmm- for what it's worth, when I start a new note and select code block and then manually type in the entire code block exactly as shown in my original issue (minus all the >'s of course) the code stays intact when leaving the note and coming back. I'm wondering if it has to do with the fact that I copied the code block out of UpNote and pasted it into Helix, and something in the formatting from UpNote screws everything up. As a test, I searched online for "Grimmory .env file" and copy-pasted the code from the AI results from Brave Search and they too stayed intact. Really thinking this must be an UpNote to Helix issue, not an issue with Helix itself.

Also FWIW, I had created a new blank note as a test and manually typed the .env file into the note and things stayed as expected. Just now I copied the code out of the test note and pasted it into my existing note that's been giving problems all along, and Helix converted the text into headers again.

The code was pasted into the exact spot in the note that I had the code at before. When I pasted it at a new position at the bottom of the note, it remains intact. Perhaps some markdown code left behind in that exact position is what caused this behavior?

So I guess I need to figure out how to properly copy-paste code into Helix from another source in a way that doesn't result in the code being converted to something other than what I intended.

Also FWIW, I had created a new blank note as a test and manually typed the .env file into the note and things stayed as expected. Just now I copied the code out of the test note and pasted it into my existing note that's been giving problems all along, and Helix converted the text into headers again. The code was pasted into the exact spot in the note that I had the code at before. When I pasted it at a new position at the bottom of the note, it remains intact. Perhaps some markdown code left behind in that exact position is what caused this behavior? So I guess I need to figure out how to properly copy-paste code into Helix from another source in a way that doesn't result in the code being converted to something other than what I intended.

Further testing reveals that the issue is only with code pasted inside a collapsible section. I can paste the exact same code block into a note outside of a collapsible section and also inside a collapsible section and the code inside gets converted into headers, and the code outside stays as just that- code.

Further testing reveals that the issue is only with code pasted inside a collapsible section. I can paste the exact same code block into a note outside of a collapsible section and also inside a collapsible section and the code inside gets converted into headers, and the code outside stays as just that- code.
Sign in to join this conversation.
No Branch/Tag specified
main
fix/vault-indication
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.2.9
v1.2.8
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.9
v1.1.8
v1.1.7
v1.1.6
v1.1.5
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
v1.0.2
v1.0.1
v1.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ArkHost/HelixNotes#138
Reference in a new issue
ArkHost/HelixNotes
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?