SMF icon indicating copy to clipboard operation
SMF copied to clipboard

The code in the tag is not displayed in the middle

Open jsqx opened this issue 4 years ago • 4 comments

The code that is added in the tag is not displayed in the middle, only in the top position.

code

Themes/default/css/index.css

.bbc_code {
    display: block;
    font-size: .78rem;
    background: #f3f3f3;
    border: 1px solid #dfdfdf;
    border-top: 2px solid #bbb;
    border-bottom: 3px solid #aaa;
    border-radius: 2px;
    margin: 1px 0 6px 0;
    padding: 3px 12px;
    overflow: auto;
    white-space: nowrap;
    max-height: 25em;

I changed the padding from 3px to 7px and the code displays in the middle:

code2

So fix it.

And I also noticed that all the old codes that are posted on the simplemachines forum have a empty space at the top. Has the author of the post left an empty space by adding the code?

Example:

https://www.simplemachines.org/community/index.php?topic=561159.msg4060260#msg4060260

jsqx avatar Aug 31 '21 16:08 jsqx

1- I don't see the first issue on SM or test site?

2- This might be an upgrader issue, looks like they have a <br/> added/converted. The code:

[code]
'show' => !empty($modSettings['hof_active']),
[/code]

These new lines should not be interpreted as such for codes, it does not happen for new ones.

DiegoAndresCortes avatar Aug 31 '21 22:08 DiegoAndresCortes

This happens for lists too e.g.

[list]
[li] <--- line break
text
[/li]
[/list]

If you edit the post and save it without doing anything, these line breaks go away.

DiegoAndresCortes avatar Sep 03 '21 00:09 DiegoAndresCortes

This seems to be a Chrome thing.

In the inspector this code is for a single line code: < code class="bbc_code" style="height: 38px;" >

The style part is not in the source.

This does not happen in FireFox

BrickOzp avatar Sep 08 '21 12:09 BrickOzp

Any chance to improve this? Chrome seems to be causing this.

It displays the same in Edge and Opera.

jsqx avatar Sep 12 '21 08:09 jsqx