diet-ng
diet-ng copied to clipboard
Content isn't separated properly.
As it can be seen on the vibe.d website's about page it's split like:
p With vibe.d we are trying to bring the highest performance possible together with a
| programming interface that is as clean as possible. At the same time the choice of
But still it's written as "aprogramming" instead of "a programming"
See the screenshot for representation in the browser.
Not sure if this is the same issue, but I am having issues where diet-ng inexplicably puts 2 elements that are on separate lines together without spacing directives.
e.g.:
button.btn.btn-primary Button 1
button.btn.btn-secondary Button 2
results in:
<button class="btn btn-primary">Button 1</button><button class="btn btn-primary">Button 2</button>
Button 1 and button 2 appear touching, but if they were separated by a newline, they would have had a slight space between them. I've had to put a span between them to make sure they get separated. I know there are spacing directives to make sure all space is removed, but that doesn't help when all the space has been removed!
This is still happening in October 2022 :-( I was going to raise a new issue but this may serve to bump it up the queue :-
// linebreaks.dt doctype html html head title Demonstration of line breaks
body
h1 Example page - showing line breaks
p This para runs onto the h1
p Two lines that run into each other without a
| trailing space at the end of the first line.
p Two lines that do NOT run into each other because there
|is trailing space at the end of the first line.
p< This is three lines without trailing spaces at
| the end of line one or line two
| or line three and
| finishing on line 4
It renders to messy HTML. Adding a trailing space to the line or indenting using two spaces does add a space between the words. Note also that the first para comes out appended to the <h1>
element and the comments don't have a trailing space before the closing comment mark :-
-->.
<!-- linebreaks.dt--><!DOCTYPE html>
<html>
<head>
<title>Demonstration of line breaks</title>
</head>
<body>
<h1>Example page - showing line breaks</h1><p>This para runs onto the h1</p>
<p>
Two lines that run into each other without atrailing space at the end of the first line.
</p>
<p>```
Two lines that do NOT run into each other because there is trailing space at the end of the first line.
</p>
<p>This is three lines without trailing spaces atthe end of line one or line two
or line three and
finishing on line 4
</p>
</body>
</html>
October 2023, 5 years - no fix.
Even Text nodes documentation example renders incorrectly:
p This is a long
| paragraph that is
| split across multiple
| lines.
Renders as This is a longparagraph ...
Also note this bug causes a regresion in vibe.d.
Workoaround via downgrading vibe.d
If someone (like me) is still interested in using vibe.d with Diet templates, the only way to use it (without this bug) right now is to use this project specification in dub.sdl
:
// Compiler needed for vibe.d version below
toolchainRequirements frontend="~>2.071.2"
// The latest vibe.d version without diet-ng buggy Diet templates
dependency "vibe-d" version="==0.7.29"
// Also specify OpenSSL version to prevent its upgrade causing errors
dependency "openssl" version="==1.1.6+1.0.1g"
Note: If you use Windows, dmd v2.071.2
installation doesn't include dub
, so you can download e.g. dub v1.9.0