DEV Community

Manuel Rivero
Manuel Rivero

Posted on • Edited on

3

Problems rendering gists in posts

{Use the questions/pointers below to guide your post — don't forget to delete the placeholder text!}

Is anyone else experiencing problems when rendering gists containing code in posts on DEV community?

I'm seeing a line for each character...

{% gist https://gist.github.com/trikitrok/a9b2b77762045a77cfd9c6854046add7 %}

package unit_tests;
import beverages.*;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.closeTo;
public class BeveragesPricingTest {
private static final double PRECISION = 0.001;
@Test
public void computes_coffee_price() {
Beverage coffee = new Coffee();
assertThat(coffee.price(), is(closeTo(1.20, PRECISION)));
}
@Test
public void computes_tea_price() {
Beverage tea = new Tea();
assertThat(tea.price(), is(closeTo(1.50, PRECISION)));
}
@Test
public void computes_hot_chocolate_price() {
Beverage hotChocolate = new HotChocolate();
assertThat(hotChocolate.price(), is(closeTo(1.45, PRECISION)));
}
@Test
public void computes_tea_with_milk_price() {
Tea teaWithMilk = new TeaWithMilk();
assertThat(teaWithMilk.price(), is(closeTo(1.60, PRECISION)));
}
@Test
public void computes_coffee_with_milk_price() {
Coffee coffeeWithMilk = new CoffeeWithMilk();
assertThat(coffeeWithMilk.price(), is(closeTo(1.30, PRECISION)));
}
@Test
public void computes_coffee_with_milk_and_cream_price() {
Coffee coffeeWithMilkAndCream = new CoffeeWithMilkAndCream();
assertThat(coffeeWithMilkAndCream.price(), is(closeTo(1.45, PRECISION)));
}
@Test
public void computes_hot_chocolate_with_cream_price() {
HotChocolateWithCream hotChocolateWithCream = new HotChocolateWithCream();
assertThat(hotChocolateWithCream.price(), is(closeTo(1.60, PRECISION)));
}
}

but if you go to check the gist it's totally fine

https://gist.github.com/trikitrok/a9b2b77762045a77cfd9c6854046add7

Any idea how to solve this?

Top comments (2)

Collapse
 
kexposito profile image
Kevin Expósito

Im facing the same issue!

Collapse
 
trikitrok profile image
Manuel Rivero

In the end I decided to stop using embedded gists in my posts...

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay