Announcement

Collapse
No announcement yet.

hr bbcode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • hr bbcode

    I would like to know how to change [hr] bbcode so it does not add <br>

    I mean
    I would like to create a post writting:
    text
    [hr tag]
    text

    and I want it to be displayed like:
    text
    -------
    text

    Currently, if I do it, it will be displayed like
    text
    -------

    text

    I do not want that extra space.
    How can I do it?

  • #2
    What is the replacement code that you're using?
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      Thanks for the answer.
      I am not using any custom replacement. It is just the default behaviour.
      The same thing happens here

      I will try to be more specific:
      When I am creating a post, I do it with 'Source' active because I am used to write down bbcode.
      So, I write something like:
      Text
      [hr bbcode here]
      Text
      I hit preview and it shows:
      Text
      ----------------------------------------

      Text
      Then I deactivate and activate 'Source', and it shows:
      Text [hr bbcode here]
      Text
      It is like when I use hr bbcode, the spaces/break lines are replaced.

      If I try:
      Text
      <hr/>
      Text
      again, is replaced:
      Text
      ----------------------------------------

      Text
      I would like hr tag to not replace any space/break line.
      In other words, how to make hr bbcode to work like the HTML tag hr.

      Comment


      • #4
        The default HTML/CSS display has a bottom margin on a horizontal rule. You would need to add custom CSS to your site to remove the margin when the <hr> tag is used within a post.

        Best way to do this is to inspect the tag in the location you want to change and see the CSS classes it uses. Apply your CSS to those classes. Or if someone has time, they can provide the customization for you. I'll try to circle back when I have time.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API - Full / Mobile
        Vote for your favorite feature requests and the bugs you want to see fixed.

        Comment


        • #5
          I have noticed that spaces / break lines are added/removed when using different bbcodes so I guess this is a generic behaviour.
          Thank you anyway.

          Comment


          • #6
            Spacing around block elements should be handled with CSS. You can apply your own custom CSS in the css_additional.css template.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API - Full / Mobile
            Vote for your favorite feature requests and the bugs you want to see fixed.

            Comment


            • #7
              Thanks again Wayne.
              This is not a case of spacing, a <br> is added.
              Look at this case:
              - Create a post and write "hello"
              - Center "hello"
              - Write something else below (not centered)
              - Enable/disable "Source" several times and you will see that a new <br> is added every time after "hello".

              If my explanation is not enough, I can make a litte video

              Comment


              • #8
                If you're using HTML and don't want the linebreaks added, then you need to select "Use HTML, do not convert linebreaks" from the Additional Options panel.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API - Full / Mobile
                Vote for your favorite feature requests and the bugs you want to see fixed.

                Comment


                • #9
                  This is getting hard for me because thanks to my lack of better explanation, it is difficult for you to give other answers.

                  Both of the problems described here happens when I am switching between Source and Default mode. (The post is not even published yet).

                  The code that handles the conversión between showing bbcode and showing things with their proper format adds or removes line breaks in a weird way.

                  I do large guides, and most of the time I do them with "Source" active.
                  After a while I wanna see how everything looks, I disable "Source" and then go back to enabling "Source" to continue working.
                  Having an [hr] in the middle of the text makes it hard to find if I want to move/replace them.
                  Having to remove the extra lines added when I have centered text everytime I use "source" is a bit annoying too.

                  Let's see if this "step by step" helps:
                  Using hr tags:
                  1 ) I enable "Source"
                  2 ) I write:
                  text 1
                  [HR TAG][/HR TAG]
                  text 2
                  3) I disable "Source" and I see:
                  text 1
                  ---------------------------------------------------------------------------

                  text 2
                  4) I enable "Source" again:
                  text 1 [HR TAG][/HR TAG]
                  text 2
                  For this case I ask: What do I need to change so hr tag is only replaced by a <hr> and not ignore/replace the line breaks I use to have it in a diferent line from the text?


                  For the centered text:
                  1 ) I enable "Source"
                  2 ) I write:
                  [CENTER tag]text 1[/CENTER tag]
                  Text 2
                  3) I disable "Source" and I see:
                  Text 1



                  Text 2
                  4) I enable "Source" again:
                  [CENTER tag]text 1[/CENTER tag]

                  Text 2
                  5) I disable "Source" again:
                  Text 1




                  Text 2
                  And a new line will appear again if I keep enabling/disabling "Source".

                  Comment


                  • #10
                    I finally did a little video using this forum.
                    First part is about hr tag showing how it adds a empty line and then it is placed next to the first line of text.

                    Next, it shows how using centered texts adds new lines again and again.

                    https://www.youtube.com/watch?v=6t6p...ature=youtu.be

                    Comment


                    • #11
                      We have no control over this. When you switch between modes, the editor program (CKEditor) we are using parses data and changes the display in your browser using its own Javascript. When you click the submit button, we get what it sends to us. We interpret it exactly how it is sent to the server because some people may want those extra lines in there. If we arbitrarily remove them, then it will cause just as many complaints. That said, the editor currently in vBulletin 5.5.5 and earlier is an older version. This is being updated in 5.5.6. Hopefully it handles this situation better. Though, I haven't read through all the release notes for CKEditor.

                      All that said, if you need precise alignment of your content, then you should use HTML (without head and body tags) to format your content and then store it with the option to not convert linebreaks. The Editor is not WYSIWYG because that is impossible when you have to support screens starting at 4 or 5 inches and increasing to 90 inches or more and with wildly varying resolutions. It is a Rich Text editor that allows you to format text into a pleasing format.
                      Translations provided by Google.

                      Wayne Luke
                      The Rabid Badger - a vBulletin Cloud demonstration site.
                      vBulletin 5 API - Full / Mobile
                      Vote for your favorite feature requests and the bugs you want to see fixed.

                      Comment

                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                      Working...
                      X