Comments (6)
Changing your example as follows to fix the errors:
fn build() {
let x = maud::html! {
head { title { "test" } };
body {
p { "Shroomstrat: " };
};
}
.into_string();
std::fs::write("./t.html", x).unwrap();
}
This creates the following output file:
<head><title>test</title></head><body><p>Shroomstrat: </p></body>
Note that the space is not removed.
from maud.
Hi, would you like to give a minimal example?
Maud doesn't minify. So I'm not sure how you're seeing this behavior.
from maud.
@FallBackITA27 If you're using the browser's inspector rather than 'view source', you're seeing the resulting DOM, not the input HTML. Insignificant whitespace is stripped by the browser's HTML parser before appearing in the DOM.
from maud.
Insignificant whitespace is stripped by the browser's HTML parser before appearing in the DOM.
Nope, it's made into text nodes which are visible to the user and you can actually interact, depending on the tag.
You can actually see this by logging child nodes on an indented element.
from maud.
Hi, would you like to give a minimal example?
fn build() {
let x = maud::html {
head { title { "test" } };
body {
p { "Shroomstrat: " };
};
}.to_string();
std::fs::write("./t.html", x.as_bytes()).unwrap();
}
The result is as stated above, where the content of p, meaning that space, is removed.
I'm unsure if the example works, I just winged it
from maud.
Huh. I'll look into it on my own, absolutely 0 idea on why the output isn't the same.
from maud.
Related Issues (20)
- Allow for XML void tag syntax HOT 2
- Documentation question: unclear on toggles HOT 7
- Feature: Hot-reload / Runtime interpretor for debug mode HOT 1
- Compiler error? HOT 3
- Allow colons in attribute names HOT 1
- not an issue, just a tip for working with tailwind + maud HOT 3
- Bump axum-core to 0.4
- Need some help with the rocket response HOT 1
- Update rocket support to 0.5 (stable) HOT 1
- Reflexion on my usage HOT 5
- split ast into a separate crate to write our own implementations which use maud syntax
- Shouldn't `escape_to_string` escape `'` characters? HOT 2
- Maud will need updating for Axum 7.0+ HOT 1
- Document recent changes to attribute name syntax
- How to make attributes use single quotes
- Bad parsing with attribute splices HOT 1
- Syntax hlighting & formatting in editors? HOT 1
- Document the way to create a full document HOT 3
- Empty class when all optional classes are omitted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maud.