Skip to content

[[syntax]] is processed in Markdown code blocks rendering #2168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeromelebleu opened this issue Jul 14, 2017 · 4 comments
Closed

[[syntax]] is processed in Markdown code blocks rendering #2168

jeromelebleu opened this issue Jul 14, 2017 · 4 comments

Comments

@jeromelebleu
Copy link

jeromelebleu commented Jul 14, 2017

I've got a README.md file which includes some kind of ini code blocks. As a subsection is surrounded by two squared brackets, it is evaluated and processed by Gitea as a link. The squared brackets are removed and the code blocks is thus modified... This is problematic since it produces wrong code blocks and can involves someone to make mistakes if he/she just copy & paste it.

For example, if I write the following:

    ```ini
    [[mediagoblin_private]]
    ```

... the produced HTML code will be:

<pre><code class="language-ini">mediagoblin_private
</code></pre>

From what I understand in reading the code and trying to alter this unwanted behavior, I found at least two solutions to prevent that:

  • do not replace the whole [[...]] with the content text if it's not a link,
  • or just do not replace it when it's in an excluded tag.

I tried both solutions and they work. For the first one, I've just commented this line. For the second one, I've replaced this line by buf.WriteString(token.String()).

As I don't know which behavior could be the best - and if there are others, they have maybe both pro/con, I let you see...

Thanks in advance!

@lunny lunny added the type/bug label Jul 14, 2017
@lunny lunny added this to the 1.3.0 milestone Jul 14, 2017
@lunny lunny modified the milestones: 1.3.0, 1.x.x Sep 22, 2017
@dsamarin
Copy link

Are there any solutions/hacks that do not require modifying the code?

@chinglinwen
Copy link

This shell snippet got wrong too, the following code can't show correctly in gitea ( Gitea Version: 1.4.0 )

if [[ ${state} == 'stop' ]]; then
        check_down
        if [[ $? == 1 ]]; then
            check_user
        else
            echo "stop success"
            exit 0
        fi
    else

Result in gitea: [[ ${state} == 'stop' ]] is not shown.

@stale
Copy link

stale bot commented Jan 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 26, 2019
@0x3333
Copy link

0x3333 commented Jan 28, 2019

This can be closed, this issue is not in effect anymore.

@lunny lunny removed this from the 1.x.x milestone Feb 1, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants