Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Problem with Block code "fences" display

Started by Raf van de Vreugde 9 years ago · 10 replies · 973 views
9 years ago

Hello everybody,

I have a problem with the display of text in the Block code "fences" (```)

This is my source:

TXT
$TTL 1h
@ IN SOA ca-lin-ns01.artesis.be. hostmaster.artesis.be. (
                2012110901      ; Serial
                1h              ; Refresh
                30m             ; Retry
                2d              ; Expire
                10m )           ; Negative caching TTL

@       IN NS   ca-lin-ns01.artesis.be.
@       IN NS   ca-lin-ns02.artesis.be.

www                     A       193.191.129.214

But, it displays as:
Selection_025|690x151

It seems that the blank lines are the source of the problem (they do not contain spaces).
I am using the Learn2 theme.

Can somebody help, please?

9 years ago

It's just CSS. There is padding of 2rem on the pre in the theme, just remove it.

9 years ago

Hi rhuk,

Thanks for the info. I am not that specialised in adapting themes.
Can you please tell me where I can find this?

Thanks,

TXT
Raf
9 years ago

To do any kind of web development you really need to learn how to use the developer tools in your browser. For example:

Installation | Grav Documentation 2017-11-28 22-12-08|690x287

This is Chrome you just inspect the element, and then look to see what CSS is causing that.

The problem now is you need to edit that .scss file and recompile the SCSS, or you need to add your own css file to override stuff.

Create a new file called learn2/css/custom.css and put:

CSS
pre {
    padding: 0 !important;
}

Reload the page.

9 years ago

Hello rhuk,

Sorry, this did not solve the issue. I got still the same problem.

Regards,

TXT
 Raf
9 years ago

Hi @rvreugde, could you please explain in detail what is your problem about exactly?

9 years ago

His problem is that the theme is not rendering the full code string, there are two lines outside of the formated code output.

@rvreugde does it works when using <pre> </pre> tags instead of the markdown triple backtick?

9 years ago

@rvreugde:
$TTL 1h
@ IN SOA ca-lin-ns01.artesis.be. hostmaster.artesis.be. (
2012110901 ; Serial
1h ; Refresh
30m ; Retry
2d ; Expire
10m ) ; Negative caching TTL

@ IN NS ca-lin-ns01.artesis.be.
@ IN NS ca-lin-ns02.artesis.be.

www A 193.191.129.214

sorry i completely misread this issue.. I just tested and it output fine:

43 AM|690x287

9 years ago

Hello rhuk,

When I use a bulleted list entry, I got the problem:

Title 1

  • This is the entry
    TXT
    
    $TTL 1h
    @ IN SOA ca-lin-ns01.artesis.be. hostmaster.artesis.be. (
                2012110901      ; Serial
                1h              ; Refresh
                30m             ; Retry
                2d              ; Expire
                10m )           ; Negative caching TTL
    

@ IN NS ca-lin-ns01.artesis.be.
@ IN NS ca-lin-ns02.artesis.be.

www A 193.191.129.214

TXT

9 years ago

Hello hugoaf and MakaryGo:

When I use the following MarkDown, even when I user the pre-tags, I got the problem. It seems that the bulleted list entry causes the problem.

Title 1

  • This is the entry
    <pre>
    $TTL 1h
    @ IN SOA ca-lin-ns01.artesis.be. hostmaster.artesis.be. (
    2012110901 ; Serial
    1h ; Refresh
    30m ; Retry
    2d ; Expire
    10m ) ; Negative caching TTL

@ IN NS ca-lin-ns01.artesis.be.
@ IN NS ca-lin-ns02.artesis.be.

www A 193.191.129.214
</pre>

9 years ago

a quick shot @rvreugde, try adding one more line between your list item and the backticks.

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 96 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 147 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 61 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 255 1 year ago