Comments (8)
Any opinions on this? I can have a go at fixing this myself, if time is the issue. I just really hope it's not by design.
from shakespeare.
I thought I'd responded to this, but apparently it didn't make it through.
There's a discussion on the Yesod mailing list about this right now. This approach is by design. If you want a workaround for now, you can turn on newline appending.
This approach may be changed in the future, but it's not clear yet that we'll actually do so.
from shakespeare.
Does closing this issue signal that this behavior is not going to be changed? Could you point me to the mailing list discussion? What do you mean by "turn on newline appending"? This is pretty much a deal-breaking bug in Hamlet for me, BTW.
from shakespeare.
There are other serious issues with Hamlet not respecting HTML whitespace semantics, too. For instance:
[|hamlet|<span>foo|]
gives me<span>foo</span>
, but[|hamlet|<span>#{foo}|]
gives me<span>\nfoovalue\n</span>
mconcat
inserts newlines between elements
Both of which are unacceptable. Are these going to be changed? Is there any documented justification for the current behavior?
from shakespeare.
Closing indicates that a bug report is not the right place for this discussion. There have been a few threads about this recently, eg:
https://groups.google.com/d/topic/yesodweb/-nTfT9SZsWQ/discussion
As far as turning on newlines, please have a look at the Haddocks:
Simply referring to this as a bug isn't going to make it true; there are valid reasons for both behaviors, and insisting that your way is the only correct way is not really going to motivate any change. A healthy discussion on the mailing list, however, will.
As far as your other cases, if they are true, they are bugs. I'd like to see a reproducing test case, as I have seen no such behavior. (If the mconcat
case is true, it's coming from blaze-html, not hamlet, so the bug report would need to be filed there.)
from shakespeare.
Apologies: that behavior is Blaze.
hamletNewlines
seems an OK workaround for now.
I suspect the current behavior is because where multiple lines represent multiple tags, you want to concatenate them all without any space in between.
Could we not have an exception to this for two adjacent lines of text, in which case a space is inserted?
from shakespeare.
Unfortunately hamletNewlines
seems to be inserting newlines where I don't want them. Specifically, if I do
[hamlet|
One ^{two}.
|]
I get the output
One
two
.
Is this desired behaviour? What can I do to work around this?
from shakespeare.
I don't believe this is coming from Hamlet, but from your definition of two
(you had a similar example above I believe). For future bug reports, can you include full test programs so we can avoid false reports?
I'm not going to make any decisions about changes to Hamlet based on a discussion in this issue. If you would like to propose changes, please do so on the mailing list.
from shakespeare.
Related Issues (20)
- Lucius and Cassius `&` not documented
- Lucius Cassius Comment syntax not documented HOT 5
- CSS Math HOT 1
- Hamlet puts <title> to <body> HOT 5
- Julius: async function cannot be parsed HOT 6
- shakespeare escape bug in #\" HOT 2
- [lucius] @supports mixing problem? HOT 4
- Test failure with GHC 9 HOT 6
- Build error with aeson-2 HOT 1
- `$maybe` and `$forall` unsupported in `Text.Shakespeare.Text` HOT 2
- fails to build with aeson-2.0 HOT 5
- Mixins should respect rule order HOT 1
- I18N, allow multiline messages in translation files
- Support lens operators in templates
- Julius arrow function with curly brace body is compiled to expression even if it's not an expression HOT 2
- Surprising behaviour of Scientific arithmetic inside a template HOT 1
- Cannot have two messages with the same parameter name of different types HOT 3
- Inconsistency between `textfile` and `stextfile` HOT 2
- Upgrading to the `LTS-20.26` implies ~100x performance regression for functions using dynamic templates.
- Add "$foreach" statement.
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 shakespeare.