Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Text with Code-tags displayed differently

    Scheduled Pinned Locked Moved Forum Feedback
    9 Posts 3 Posters 1.1k Views
    Loading More Posts
    • 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.
    • Bob.DigB
      Bob.Dig LAYER 8
      last edited by Bob.Dig

      When I change my own posting and saving it, "code" will be displayed differently and much favorably to me. Also I can hover over it and a copy shortcut is displayed.

      Capture.PNG

      Sadly when I reload the page again, it is all gone.

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        When you use the code block it defaults to a generic automatic lexer for syntax highlighting that isn't always accurate. You can override that by specifying the lexer to use immediately after the opening three backticks.

        ```config
        blahblahblah
        ```

        You can try different ones like shell, diff, php and other languages. If you want to strip the formatting and go plain you can use text as well.

        I rarely rely on the automatic behavior since it often guesses wrong (especially for shell input/output prompts)

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          Testing....

          Shell:

          *** Welcome to pfSense 2.7.0-RELEASE (amd64) on t70 ***
          
           WAN (wan)       -> igb0       -> v4/DHCP4: 172.21.16.226/24
           LAN (lan)       -> igb1       -> v4: 192.168.226.1/24
           OPT1 (opt1)     -> igb2       -> v4: 10.112.20.1/26
           SWITCH (opt2)   -> igb3       -> v4: 192.168.70.1/25
           VLAN229 (opt3)  -> igb0.229   -> v4: 10.229.0.10/24
           VTI0 (opt9)     -> ipsec1     -> v4: 10.66.11.1/30
           OPT10 (opt10)   -> pppoe0     -> 
           VLAN50 (opt11)  -> igb1.50    -> v4: 10.10.50.10/26
          
           0) Logout (SSH only)                  9) pfTop
           1) Assign Interfaces                 10) Filter Logs
           2) Set interface(s) IP address       11) Restart webConfigurator
           3) Reset webConfigurator password    12) PHP shell + pfSense tools
           4) Reset to factory defaults         13) Update from console
           5) Reboot system                     14) Disable Secure Shell (sshd)
           6) Halt system                       15) Restore recent configuration
           7) Ping host                         16) Restart PHP-FPM
           8) Shell
          
          Enter an option: 
          Connection to t70 closed.
          

          Auto:

          *** Welcome to pfSense 2.7.0-RELEASE (amd64) on t70 ***
          
           WAN (wan)       -> igb0       -> v4/DHCP4: 172.21.16.226/24
           LAN (lan)       -> igb1       -> v4: 192.168.226.1/24
           OPT1 (opt1)     -> igb2       -> v4: 10.112.20.1/26
           SWITCH (opt2)   -> igb3       -> v4: 192.168.70.1/25
           VLAN229 (opt3)  -> igb0.229   -> v4: 10.229.0.10/24
           VTI0 (opt9)     -> ipsec1     -> v4: 10.66.11.1/30
           OPT10 (opt10)   -> pppoe0     -> 
           VLAN50 (opt11)  -> igb1.50    -> v4: 10.10.50.10/26
          
           0) Logout (SSH only)                  9) pfTop
           1) Assign Interfaces                 10) Filter Logs
           2) Set interface(s) IP address       11) Restart webConfigurator
           3) Reset webConfigurator password    12) PHP shell + pfSense tools
           4) Reset to factory defaults         13) Update from console
           5) Reboot system                     14) Disable Secure Shell (sshd)
           6) Halt system                       15) Restore recent configuration
           7) Ping host                         16) Restart PHP-FPM
           8) Shell
          
          Enter an option: 
          Connection to t70 closed.
          
          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by stephenw10

            No difference I can see. In both cases it shows the code box differently only on first viewing.

            Edit: Huh, after posting that reply they initially show as expected. But then revert back after refreshing the page. 🤔

            Bob.DigB 1 Reply Last reply Reply Quote 1
            • Bob.DigB
              Bob.Dig LAYER 8 @stephenw10
              last edited by

              @stephenw10 said in Text with Code-tags displayed differently:

              In both cases it shows the code box differently only on first viewing.

              Right! So something could be optimized I guess. The "first" view is the best in my eyes.

              1 Reply Last reply Reply Quote 0
              • jimpJ
                jimp Rebel Alliance Developer Netgate
                last edited by

                Hmm, wonder what happens with others.

                Diff:

                diff --git a/src/etc/inc/openvpn.inc b/src/etc/inc/openvpn.inc
                index 0281a094cb..1e63e3dfbf 100644
                --- a/src/etc/inc/openvpn.inc
                +++ b/src/etc/inc/openvpn.inc
                @@ -899,7 +899,7 @@ function openvpn_reconfigure($mode, $settings) {
                 	// OpenVPN defaults to SHA1, so use it when unset to maintain compatibility.
                 	$digest = !empty($settings['digest']) ? $settings['digest'] : "SHA1";
                 
                -	$interface = get_failover_interface($settings['interface']);
                +	$interface = $settings['interface'];
                 	// The IP address in the settings can be an IPv4 or IPv6 address associated with the interface
                 	$ipaddr = $settings['ipaddr'];
                

                PHP:

                require_once('guiconfig.inc');
                require_once('functions.inc');
                require_once('notices.inc');
                require_once("pkg-utils.inc");
                

                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  Not sure if it's related, but when I have the browser debug console open and bring up the editor where it shows, it has a log entry saying it's initializing highlight.js.

                  But when loading the page directly it hits a JS error:

                  Uncaught (in promise) TypeError: config.theme is undefined
                  

                  And other processing seems to die there.

                  So it may be a NodeBB issue, though I'm not seeing any other hits on that error (other than someone here on the forum mentioning it back in June).

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 2
                  • jimpJ
                    jimp Rebel Alliance Developer Netgate
                    last edited by

                    Looks like a NodeBB bug

                    https://github.com/NodeBB/NodeBB/issues/11708

                    There is already a fix committed so hopefully should be in whatever upgrade we do next.

                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

                    1 Reply Last reply Reply Quote 1
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      Aha, nice find! 👍

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.