Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Qt.io webservices
  4. Showing literal backticks in posts here
Forum Updated to NodeBB v4.3 + New Features

Showing literal backticks in posts here

Scheduled Pinned Locked Moved Solved Qt.io webservices
16 Posts 5 Posters 2.8k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by mrjj
    #4

    Hi
    Ahhh.
    alt text

    ```
    
    1 Reply Last reply
    1
    • sierdzioS sierdzio

      OK, it worked but outside of any code block :/ You need to prefix each backtick with a backslash.

      Now in a code block:

      \```
      

      I've just put a single backslash in front of all 3 backticks, but it is being printed, that is bad.

      ```
      

      Aha!

      So, summary for everybody: use 3x tilde ~ to wrap around 3 visible backticks.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #5

      @sierdzio , @mrjj
      Sorry, I''m not following what you guys are doing, can you be more explicit? And tildes don't seem to work for me.
      I would like the triple-backtick to come out as code/literal/monspace I can't even tell whether yours are?

      And, what about the triple-backtick in-line: ''' <- like this but with backticks?

      Please try to explain for an idiot like em exactly what you want me to type?

      Triple-tilde, then triple-backtick, then triple-tilde:

      ```
      

      Oh! Are triple-tildes like triple-ticks for code blocks then?

      What about these backticks but in-line?

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #6

        Nope, tilde does not work inline :-(

        ```
        Oh! This works! So it is: backtick space 3xbacktick space backtick

        (Z(:^

        JonBJ 1 Reply Last reply
        1
        • sierdzioS sierdzio

          Nope, tilde does not work inline :-(

          ```
          Oh! This works! So it is: backtick space 3xbacktick space backtick

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #7

          @sierdzio
          Hello ``` world!

          Oh, OK! I promised a "bonus point" for that, but I think the need to put the spaces in deducts from that? :)

          Going back to tildes/block, you didn't answer:

          Oh! Are triple-tildes like triple-ticks for code blocks then?

          sierdzioS 1 Reply Last reply
          0
          • JonBJ JonB

            @sierdzio
            Hello ``` world!

            Oh, OK! I promised a "bonus point" for that, but I think the need to put the spaces in deducts from that? :)

            Going back to tildes/block, you didn't answer:

            Oh! Are triple-tildes like triple-ticks for code blocks then?

            sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #8

            @JonB said in Showing literal backticks in posts here:

            @sierdzio
            Hello ``` world!

            Oh, OK! I promised a "bonus point" for that, but I think the need to put the spaces in deducts from that? :)

            Going back to tildes/block, you didn't answer:

            Oh! Are triple-tildes like triple-ticks for code blocks then?

            Seems so.

            int nothing = 0;
            function();
            
            int nothing = 0;
            function();
            

            First block is created with tildes, second with backticks.

            (Z(:^

            JonBJ 1 Reply Last reply
            1
            • sierdzioS sierdzio

              @JonB said in Showing literal backticks in posts here:

              @sierdzio
              Hello ``` world!

              Oh, OK! I promised a "bonus point" for that, but I think the need to put the spaces in deducts from that? :)

              Going back to tildes/block, you didn't answer:

              Oh! Are triple-tildes like triple-ticks for code blocks then?

              Seems so.

              int nothing = 0;
              function();
              
              int nothing = 0;
              function();
              

              First block is created with tildes, second with backticks.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #9

              @sierdzio
              And where is this documented...? :)

              Thanks, great answers, I'll try to remember the two ways for block- or in-line.

              sierdzioS 1 Reply Last reply
              0
              • JonBJ JonB

                @sierdzio
                And where is this documented...? :)

                Thanks, great answers, I'll try to remember the two ways for block- or in-line.

                sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #10

                @JonB said in Showing literal backticks in posts here:

                @sierdzio
                And where is this documented...? :)

                Dunno, it was just a guess :-)

                It seems to be part of Markdown: https://sourceforge.net/p/tilde/wiki/markdown_syntax/#md_ex_code but most guides for MD do not mention it. Some claim it's for preformatted text and not for code.

                Thanks, great answers, I'll try to remember the two ways for block- or in-line.

                There seems to be another way (since NodeBB supports Markdown syntax): Use TWO backticks if you want to use backticks inside of a block.

                like `this`, see?

                It's described in https://www.markdownguide.org/basic-syntax/#code

                (Z(:^

                JonBJ 1 Reply Last reply
                1
                • sierdzioS sierdzio

                  @JonB said in Showing literal backticks in posts here:

                  @sierdzio
                  And where is this documented...? :)

                  Dunno, it was just a guess :-)

                  It seems to be part of Markdown: https://sourceforge.net/p/tilde/wiki/markdown_syntax/#md_ex_code but most guides for MD do not mention it. Some claim it's for preformatted text and not for code.

                  Thanks, great answers, I'll try to remember the two ways for block- or in-line.

                  There seems to be another way (since NodeBB supports Markdown syntax): Use TWO backticks if you want to use backticks inside of a block.

                  like `this`, see?

                  It's described in https://www.markdownguide.org/basic-syntax/#code

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #11

                  @sierdzio
                  Just resurrecting this after 4 years :)

                  You get a double-extra-bonus point if you can find anyway of showing a line of ``` (triple-backtick) inside a multiline code block

                  multi line
                  show line of 3-backticks here, how? for example, ` ``` ` can't be used it shows too many
                  multi line
                  show line of 3-backticks here, how?
                  multi line
                  

                  So that one can show exactly what users can type to do multiline code blocks.

                  Reason is https://forum.qt.io/topic/156437/ui-detect-mouse-event-on-objects/16, where you can see I cannot get my ``` lines inside the code block as I would like.

                  :)

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by SGaist
                    #12

                    Testing something:

                    ``` ```
                    
                    \```
                    

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by JonB
                      #13

                      :) Neither of those is good enough...! I cannot find any way to put ``` into middle of a code block ;)

                      Pl45m4P 1 Reply Last reply
                      0
                      • JonBJ JonB

                        :) Neither of those is good enough...! I cannot find any way to put ``` into middle of a code block ;)

                        Pl45m4P Offline
                        Pl45m4P Offline
                        Pl45m4
                        wrote on last edited by Pl45m4
                        #14

                        @JonB

                        Hello
                        ``` 
                        World
                        ```
                        triple single backticks
                        ```
                        

                        Edit:
                        Like this @JonB ?

                        Since NodeBB uses markdown language and the "blocks" / paragraphs of text or code can be "cascaded" (wanky description from my side XD ) , you can choose four single backticks for your code style and then three single ones can be rendered inside properly even without escaping them.
                        Not sure if bug or feature :3
                        But it seems to work


                        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                        ~E. W. Dijkstra

                        JonBJ 1 Reply Last reply
                        2
                        • Pl45m4P Pl45m4

                          @JonB

                          Hello
                          ``` 
                          World
                          ```
                          triple single backticks
                          ```
                          

                          Edit:
                          Like this @JonB ?

                          Since NodeBB uses markdown language and the "blocks" / paragraphs of text or code can be "cascaded" (wanky description from my side XD ) , you can choose four single backticks for your code style and then three single ones can be rendered inside properly even without escaping them.
                          Not sure if bug or feature :3
                          But it seems to work

                          JonBJ Offline
                          JonBJ Offline
                          JonB
                          wrote on last edited by JonB
                          #15

                          @Pl45m4 said in Showing literal backticks in posts here:

                          you can choose four single backticks for your code style and then three single ones can be rendered inside properly even without escaping them.

                          Ohhhh! And where did you find that documented?!

                          abc
                          ```
                          def
                          

                          Which I wrote as:

                          ````
                          abc
                          ```
                          def
                          ````
                          

                          !! ;-)

                          Pl45m4P 1 Reply Last reply
                          0
                          • JonBJ JonB

                            @Pl45m4 said in Showing literal backticks in posts here:

                            you can choose four single backticks for your code style and then three single ones can be rendered inside properly even without escaping them.

                            Ohhhh! And where did you find that documented?!

                            abc
                            ```
                            def
                            

                            Which I wrote as:

                            ````
                            abc
                            ```
                            def
                            ````
                            

                            !! ;-)

                            Pl45m4P Offline
                            Pl45m4P Offline
                            Pl45m4
                            wrote on last edited by Pl45m4
                            #16

                            @JonB said in Showing literal backticks in posts here:

                            Ohhhh! And where did you find that documented?!

                            Nowhere, was a mix of trial and error and somewhere on StackOverflow, which uses the same markup style, was mentioned that you can "stack" these sections.
                            Because three backticks are no longer limiting the code block, you can display them.
                            I think you can extend that infinitely. Eight, nine, ten or more "layers", while n - 1 times the character which sets up your section is not affected and is displayed properly.

                            Edit:

                            From clicking the "Help" button, I found out that you can also display three backticks using a 4 - space - indentation (in this case it's always four spaces to define the code block).

                            Hello
                            ```
                            World
                            

                            written like:

                            ____ Hello
                            ____ ```
                            ____ World

                            Btw:
                            Just look at this ;-)
                            (Markup is fun :D)

                            Hello World


                            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                            ~E. W. Dijkstra

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved