[SOLVED] GambasOne Highlighting: missing underscores

Feel free to talk about non programming issues here.
User avatar
stevedee
Posts: 514
Joined: Monday 20th March 2017 6:06pm

[SOLVED] GambasOne Highlighting: missing underscores

Post by stevedee » Wednesday 15th December 2021 12:32pm

I'm back on the trail of my missing underscores, which I mentioned in an earlier post.

Note: I'm using this post to test the issue...so you may ignore me!



If I post this:-
Const DB_NAME As String = "config.sqlite"
Const SETTINGS_PATH As String = ".config/leveller"

...using the 'code' display feature, it looks like this:-

Code: Select all

Const DB_NAME As String = "config.sqlite"
Const SETTINGS_PATH As String = ".config/leveller"
...while using the "gb" button it looks like this:-
Const DB_NAME As String = "config.sqlite"
Const SETTINGS_PATH As String = ".config/leveller"
SETTINGS_PATH shows OK while writing this in the post editor, but not in my preview, when I simply see this:-
SETTINGS PATH

On 3 different laptops, the underscore is missing when viewing the post.
It gets weirder.
...SOMETIMES, when viewing on my phone, the underscore is missing, sometimes its not.
Const DB_NAME As String = "config.sqlite"
Const SETTINGS_PATH As String = ".config/leveller"
'space
 Const DB_NAME As String = "config.sqlite"
.
OK...
SOLVED: ...by adding a space line I'm pretty sure that this is a display problem on Firefox (with my configs on Peppermint and Mint OS).
The white display area for the stuff between the tags gb & /gb is not high enough, so it sometimes clips out the underscores!


It could be a combination of Desktop Theme, font size, font type, or who knows what...
Last edited by stevedee on Tuesday 28th December 2021 9:32am, edited 1 time in total.

User avatar
cogier
Site Admin
Posts: 875
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by cogier » Wednesday 15th December 2021 4:28pm

Fascinating. By clicking on screenshots of Chromium and Firefox, you can see that Firefox uses a larger font that then hides the underscore. See video.

User avatar
stevedee
Posts: 514
Joined: Monday 20th March 2017 6:06pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by stevedee » Wednesday 15th December 2021 4:42pm

cogier wrote:
Wednesday 15th December 2021 4:28pm
...Firefox uses a larger font that then hides the underscore.
Thanks Charlie.

Is the Gambas highlighter editable? I was wondering if a dummy blank line could be added to the entered text.

User avatar
cogier
Site Admin
Posts: 875
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by cogier » Wednesday 15th December 2021 5:57pm

I'll be honest, I have no idea. Jornmo sorted all this for the site, which is why I asked for his help. I have not heard from him in some time. The idea of putting up the site was simply to replace the 'GambasGuru' (If I remember its name correctly) site. If you feel that you could look at this, let me know, and I will give you access.

User avatar
stevedee
Posts: 514
Joined: Monday 20th March 2017 6:06pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by stevedee » Wednesday 15th December 2021 6:56pm

cogier wrote:
Wednesday 15th December 2021 5:57pm
I'll be honest, I have no idea. Jornmo sorted all this for the site...
Hey Charlie, don't worry about it...not worth losing sleep over. I have no idea how this feature works.

And I still think your site has been more successful than its predecessors .

BruceSteers
Posts: 766
Joined: Thursday 23rd July 2020 5:20pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by BruceSteers » Thursday 16th December 2021 12:05pm

gotta be some code on the server somewhere.

I'd agree the gb highlighting could do with spacing/margin, and Charlie is always the first to point out if our gambas apps need spacing/margin ;) :lol: hehe


i now habitually make the first and last line of posted code have a single quote

eg..

gb
'
CodeHere()
'
/gb

i got lots of php experience Charlie if you want me to have a looksee and see if edits could be poss.
a quick look at page source tells me it's bbstyle(22) , wherever that is...

User avatar
stevedee
Posts: 514
Joined: Monday 20th March 2017 6:06pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by stevedee » Wednesday 22nd December 2021 10:52pm

Charlie, so I started out thinking that we needed to modify the code to produce a blank line at the end of each code snippet.
But a much better idea is to simply add some padding to make it look like this:-
WithPadding.png
WithPadding.png (84.45 KiB) Viewed 1833 times
To do this, just modify the Theme.css file like this:-
Add2Theme.css.png
Add2Theme.css.png (126.48 KiB) Viewed 1833 times
Looking at this post, it may be an idea to also tweak the line spacing, because on my screen the underscores look a bit close to the next line. Anyway, something else to discuss.



BTW, you don't need admin access to view the code. Just use your web browser developer tools to make & test changes.
Obviously you do need admin access to make the changes global/permanent on the GambasOne website.

The Highlighter code is on Github: https://github.com/syntaxhighlighter/syntaxhighlighter

I hope this helps.

BruceSteers
Posts: 766
Joined: Thursday 23rd July 2020 5:20pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by BruceSteers » Friday 24th December 2021 2:51pm

[Edit]

I thinks that's your end Charlie.

I had a study of the syntaxhighlighter script for this site, a lack of json experience and a lack of linefeeds in the code make it really hard to grasp.
It looks more like just a bunch of functions to interpret the relevant code style displayed in the box (that is formatted from a different phpBB page).

Like how gb.highlight has the highlight variables Comment, Symbol, Function,Text, etc that all the different highlighters set depending on the code then the TextEditor displays the colours.

In gambas terms Charlie sent me the sites gb.eval.highlight not the gb.form.editor ;)

Steve's idea here sounds simple but on the page that loads highlighter the code not in the code so here's hoping you can find it Charlie :)

Happy Chrimbo everyone :)
Last edited by BruceSteers on Friday 24th December 2021 2:56pm, edited 2 times in total.

User avatar
cogier
Site Admin
Posts: 875
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by cogier » Friday 24th December 2021 2:52pm

Hi Steve, can you email me a modified copy of the file as I am having issues finding the correct text.

EDIT
Steve's idea here is simple but on the page that loads the code not in the code so here's hoping you can find it Charlie
Hi Bruce, and where do you think that will be?

BruceSteers
Posts: 766
Joined: Thursday 23rd July 2020 5:20pm

Re: [SOLVED] GambasOne Highlighting: missing underscores

Post by BruceSteers » Friday 24th December 2021 3:12pm

cogier wrote:
Friday 24th December 2021 2:52pm
Hi Steve, can you email me a modified copy of the file as I am having issues finding the correct text.

EDIT
Steve's idea here is simple but on the page that loads the code not in the code so here's hoping you can find it Charlie
Hi Bruce, and where do you think that will be?
(Note, above post edited)

well i don't know, i'm good at path finding so i'd start with viewtopic.php then trace the code from there.
(i can't as php works server-side so the code i receive is not the original)

here's the output code for a gambas highlighted post i sent...

Code: Select all

div>
      <div class="syntaxhighlighter  gambas">
        <table cellspacing="0" cellpadding="0" border="0">
          
          <tbody>
            <tr>
              <td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div><div class="line number3 index2 alt2">3</div><div class="line number4 index3 alt1">4</div><div class="line number5 index4 alt2">5</div><div class="line number6 index5 alt1">6</div><div class="line number7 index6 alt2">7</div></td>
              <td class="code">
                <div class="container"><div class="line number1 index0 alt2"><code class="gambas keyword">Dim</code> <code class="gambas plain">tBox </code><code class="gambas keyword">As</code> <code class="gambas plain">TextBox = </code><code class="gambas keyword">Me</code><code class="gambas plain">[</code><code class="gambas string">"tbfrequency"</code> <code class="gambas plain">&amp; whichradio]</code></div><div class="line number2 index1 alt1"><code class="gambas plain">tBox.Text = </code><code class="gambas string">"123•456"</code> </div><div class="line number3 index2 alt2">&nbsp;</div><div class="line number4 index3 alt1"><code class="gambas comments">' or''</code></div><div class="line number5 index4 alt2">&nbsp;</div><div class="line number6 index5 alt1"><code class="gambas keyword">Dim</code> <code class="gambas plain">tBox </code><code class="gambas keyword">As</code> <code class="gambas plain">TextBox = fMain[</code><code class="gambas string">"tbfrequency"</code> <code class="gambas plain">&amp; whichradio]</code></div><div class="line number7 index6 alt2"><code class="gambas plain">tBox.Text = </code><code class="gambas string">"123•456"</code> </div></div>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
Looks like i should be able to find a "gambas" file of sorts for the highlight style but i can't find a gambas file of any sort in the code i have, it could all bee in the syntaxhighlighter.js file?

I wondering if Tobias Boege may be able to help us? looks like he co-wrote it and he is on the gambas M/L?

Post Reply