🐛 Bug: Automatic Link For Tracim Contents Are Applied Inside Code Blocs

by ADMIN 73 views

Introduction

In the latest version of Tracim (2025-04.00), a bug has been discovered that affects the rendering of code blocs. When creating a code bloc and writing a number preceded by a # symbol (similar to GitHub's syntax), it is interpreted as a link when rendered. This issue prevents users from writing #12345 without it being rendered as a link. In this article, we will delve into the issue description, provide a step-by-step guide on how to reproduce the problem, and discuss potential solutions.

Issue Description

The issue arises when creating a code bloc in Tracim. When a user writes a number preceded by a # symbol, it is mistakenly interpreted as a link when rendered. This behavior is not desirable, as it prevents users from writing #12345 without it being rendered as a link. The parsing for content links should not be executed inside code blocs.

How to Reproduce

To reproduce this issue, follow these steps:

  1. Open a note in edition: Start by opening a note in the Tracim editor.
  2. Add a code bloc: Add a code bloc to the note. The language for syntax highlight does not matter.
  3. Write #1 inside the code block: Write #1 inside the code block.
  4. Save the note: Save the note.
  5. The view version replace the #1 by the label of the content id 1: Observe that the #1 is replaced by the label of the content id 1 when rendered.

Screenshots

Unfortunately, there are no screenshots available to illustrate this issue.

What Browsers are You Seeing the Problem On?

No specific browsers have been identified as being affected by this issue.

What Devices are You Seeing the Problem On?

No specific devices have been identified as being affected by this issue.

Related PR

There is no related PR (Pull Request) associated with this issue.

Potential Solutions

To resolve this issue, the following solutions can be considered:

  1. Modify the parsing logic: Modify the parsing logic to exclude code blocs from content link parsing.
  2. Add a flag to ignore content links: Add a flag to ignore content links inside code blocs.
  3. Improve syntax highlighting: Improve syntax highlighting to prevent the # symbol from being interpreted as a link.

Conclusion

In conclusion, the automatic link for Tracim contents applied inside code blocs is a bug that needs to be addressed. By following the steps outlined in this article, users can reproduce the issue and understand the problem. Potential solutions have been proposed to resolve this issue, and it is essential to implement one of these solutions to prevent users from experiencing this problem.

Recommendations

To prevent this issue from occurring, we recommend the following:

  1. Use a different syntax: Use a different syntax for referencing content, such as [content id].
  2. Avoid using # symbol: Avoid using the # symbol in code blocs to prevent it from interpreted as a link.
  3. Wait for a fix: Wait for a fix to be implemented to resolve this issue.

Introduction

In our previous article, we discussed the issue of automatic links being applied to Tracim contents inside code blocs. This bug has been causing problems for users who want to write code without it being interpreted as a link. In this Q&A article, we will answer some frequently asked questions about this issue and provide additional information to help users understand and resolve the problem.

Q: What is the cause of this issue?

A: The cause of this issue is the parsing logic in Tracim, which interprets the # symbol as a link when it is followed by a number. This logic is not specific to code blocs and can affect other types of content as well.

Q: How can I reproduce this issue?

A: To reproduce this issue, follow these steps:

  1. Open a note in edition.
  2. Add a code bloc to the note.
  3. Write #1 inside the code block.
  4. Save the note.
  5. Observe that the #1 is replaced by the label of the content id 1 when rendered.

Q: What browsers are affected by this issue?

A: Unfortunately, we do not have information on specific browsers that are affected by this issue. However, it is likely that all browsers that support Tracim will be affected.

Q: What devices are affected by this issue?

A: We do not have information on specific devices that are affected by this issue. However, it is likely that all devices that support Tracim will be affected.

Q: How can I prevent this issue from occurring?

A: To prevent this issue from occurring, you can use a different syntax for referencing content, such as [content id]. Alternatively, you can avoid using the # symbol in code blocs to prevent it from being interpreted as a link.

Q: Is there a fix available for this issue?

A: Unfortunately, we do not have a fix available for this issue at this time. However, we are working on resolving the problem and will provide an update as soon as a fix is available.

Q: How can I report this issue?

A: If you are experiencing this issue, please report it to our support team so that we can investigate and resolve the problem. You can report the issue by submitting a ticket through our support portal.

Q: What is the status of this issue?

A: We are currently investigating this issue and working on a fix. We will provide an update as soon as a fix is available.

Q: Will this issue be resolved in the next version of Tracim?

A: We are working on resolving this issue as soon as possible. However, we cannot guarantee that it will be resolved in the next version of Tracim. We will provide an update as soon as a fix is available.

Conclusion

In conclusion, the automatic link for Tracim contents applied inside code blocs is a bug that needs to be addressed. By following the steps outlined in this article, users can reproduce the issue and understand the problem. We are working on resolving the issue and will provide an update as soon as a fix is available. In the meantime, users can use a different syntax for referencing content or avoid using the # symbol in code blocs to prevent the issue from occurring.