Broken/Non-standard AsciiDoc Syntax and Formatting #1120

Closed
opened 2023-07-30 16:37:25 +02:00 by inference · 5 comments
Image

AsciiDoc formatting is not respected on Codeberg, such as escaped links in headings, and first-level headings being stripped out entirely; this is not how AsciiDoc should be rendered as it is not compliant with the official AsciiDoc syntax and AsciiDoc/AsciiDoctor formatting. This issue makes it borderline impossible to continue using Codeberg for my AsciiDoc projects, and the issue does not occur on upstream Gitea, making it an issue of either Forgejo or Codeberg (likely a renderer issue, meaning the renderer isn't compliant with standard AsciiDoc formatting and/or syntax, which shouldn't be the case since AsciiDoc is fully standardised). I fully classify this as a bug even if it is a Codeberg design decision as it breaks standardisation with AsciiDoc (AsciiDoc is not like Markdown, with different variants; when rendered as-is, it should be fully compliant).

To reproduce, create an AsciiDoc file with first-level heading (which is not shown after rendering), and escaped links in headings (links are still active). It is possible there are more issues with AsciiDoc rendering I have not yet noticed.

Codeberg example (non-compliant AsciiDoc formatting)

GitHub example (compliant AsciiDoc formatting)

My personal Gitea instance example (compliant AsciiDoc formatting)

<!-- NOTE: If you wish to report a security issue, please send an email to contact@codeberg.org (for Forgejo, see: https://forgejo.org/.well-known/security.txt) instead. Thank you. Welcome to the Codeberg Community Tracker. This is the place central for bug reports, feature requests and feedback. If you are not sure whether you should use trackers of other Codeberg Projects, then you should use this one. Please keep the following in mind: - Please check https://github.com/go-gitea/gitea/issues or https://codeberg.org/forgejo/forgejo to confirm that your issue hasn't already been reported. Codeberg uses Forgejo (referred to as the "upstream"), which is based on Gitea. - This is *not* a customer support hotline. We are volunteers with limited time and resources, and we consider you, the reporter, to be one as well. Please maintain a courteous and respectful tone, and provide as much information as possible, so that we can work together. - We may take a while with resolving your issue. Your work is still important, even if we cannot acknowledge it directly. Thank you for reporting your findings and giving feedback on Codeberg. ## FAQ ### What happens after I open an issue? Separate contributors will use your issue to communicate with each other. It will also be used to provide updates. There is a decent chance that we will ask you for additional feedback or information. ### sing_up: I noticed a typo in the URL of the registration page. This is an intentional, temporary, surprisingly effective change that helps us against spam. Nice catch! ### I want to contribute to Codeberg! That's awesome, thank you! Take a look at https://codeberg.org/Codeberg/Projects and this tracker, we have a variety of both technical and non-technical tasks that we need help with. --> AsciiDoc formatting is not respected on Codeberg, such as escaped links in headings, and first-level headings being stripped out entirely; this is not how AsciiDoc should be rendered as it is not compliant with the official AsciiDoc syntax and AsciiDoc/AsciiDoctor formatting. This issue makes it borderline impossible to continue using Codeberg for my AsciiDoc projects, and the issue does not occur on upstream Gitea, making it an issue of either Forgejo or Codeberg (likely a renderer issue, meaning the renderer isn't compliant with standard AsciiDoc formatting and/or syntax, which shouldn't be the case since AsciiDoc is fully standardised). I fully classify this as a bug even if it is a Codeberg design decision as it breaks standardisation with AsciiDoc (AsciiDoc is not like Markdown, with different variants; when rendered as-is, it should be fully compliant). To reproduce, create an AsciiDoc file with first-level heading (which is not shown after rendering), and escaped links in headings (links are still active). It is possible there are more issues with AsciiDoc rendering I have not yet noticed. [Codeberg example (non-compliant AsciiDoc formatting)](https://codeberg.org/inference/key/src/branch/stable/ssh.adoc) [GitHub example (compliant AsciiDoc formatting)](https://github.com/inferenceus/key/blob/stable/ssh.adoc) [My personal Gitea instance example (compliant AsciiDoc formatting)](https://src.inferencium.net/Inferencium/doc/src/branch/stable/specification/system/aa000.adoc)
Image
Owner

Can you review the section in https://codeberg.org/Codeberg-Infrastructure/build-deploy-forgejo/src/branch/codeberg-1.19/etc/gitea/conf/base.ini#L203 to see if there's something obviously wrong in our configuration?

Can you review the section in https://codeberg.org/Codeberg-Infrastructure/build-deploy-forgejo/src/branch/codeberg-1.19/etc/gitea/conf/base.ini#L203 to see if there's something obviously wrong in our configuration?
Image
Author

Thanks for the response. I have reviewed my own code and the Gitea code (since Forgejo is Gitea-based), and have noticed that (as per Gitea documentation) you don't seem to have the showtitle argument in the AsciiDoc renderer code.

As for why escaped links are still showing on Codeberg, despite not showing elsewhere, I see no issue there, making it likely to be a back-end or AsciiDoctor issue rather than a front-end issue.

Thanks for the response. I have reviewed my own code and the Gitea code (since Forgejo is Gitea-based), and have noticed that (as per [Gitea documentation](https://docs.gitea.com/next/administration/external-renderers#appini-file-configuration)) you don't seem to have the `showtitle` argument in the AsciiDoc renderer code. As for why escaped links are still showing on Codeberg, despite not showing elsewhere, I see no issue there, making it likely to be a back-end or AsciiDoctor issue rather than a front-end issue.
Image
Owner

As for why escaped links are still showing on Codeberg, despite not showing elsewhere, I see no issue there, making it likely to be a back-end or AsciiDoctor issue rather than a front-end issue.

Yeah it's an issue from Forgejo/Gitea, it convert's all #XXX to issues, which makes sense in issue comments, but not in documents, but there's no condition to avoid that yet. I will open an PR to add the showtitle attribute as that seems fine and doesn't seem to break anything. As for the issue converting, that has to be fixed on the Forgejo side.

> As for why escaped links are still showing on Codeberg, despite not showing elsewhere, I see no issue there, making it likely to be a back-end or AsciiDoctor issue rather than a front-end issue. Yeah it's an issue from Forgejo/Gitea, it convert's all `#XXX` to issues, which makes sense in issue comments, but not in documents, but there's no condition to avoid that _yet_. I will open an PR to add the `showtitle` attribute as that seems fine and doesn't seem to break anything. As for the issue converting, that has to be fixed on the Forgejo side.
Image
Owner

Opened Codeberg-Infrastructure/build-deploy-forgejo#110 to fix the title issue.
Opened forgejo/forgejo#1170 to fix the conversion of #XXX to links.

Opened https://codeberg.org/Codeberg-Infrastructure/build-deploy-forgejo/pulls/110 to fix the title issue. Opened https://codeberg.org/forgejo/forgejo/pulls/1170 to fix the conversion of `#XXX` to links.
Image
Author

@Gusted @fnetX You have my sincere thank you for fixing both the showtitle issue and the issue-numbers-in-documents issue.

I have switched from Gitea to Forgejo on my personal Git server, and appreciate the handling of these issues and the reasoning behind them. Keep up the good work!

@Gusted @fnetX You have my sincere thank you for fixing both the `showtitle` issue and the issue-numbers-in-documents issue. I have switched from Gitea to Forgejo on my personal Git server, and appreciate the handling of these issues and the reasoning behind them. Keep up the good work!
Sign in to join this conversation.
No milestone
No project
No assignees
3 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
Codeberg/Community#1120
No description provided.