Comments (4)
Hi,
prettyprint is not about PHP compilation but as in pug-js, it's for final HTML output. For PHP debugging, I created the phpSingleLine option. You can pass it to true to get a new line for each PHP statement generated.
But I'm agree prettyprint=true
as no real meaning except maybe to display HTML for a demonstration. In production, you should always set it to false. And for inline tags render, use:
span a
span b
To get ab
and:
span a
=" "
span b
To get a b
, or you can also:
| #[span a] #[span b]
This is the recommended syntax for long texts with inline tags inside, like in:
| I'm #[strong happy] to see you.
To come back to prettyprint, it can be handled by an other program to compress or to beautify. But this is a port of pug-js. We try to implement pug-js features as it and adapt them to PHP syntax and possibilities as close as possible to the original pug to provide a standard solution.
It's out of the question to display all tags with PHP. And the priority remains to allow in production (prettyprint=false) all the syntaxes above to be able to display inline tags with or without spaces between.
If I can improve this rendering without break this logic and with no extra PHP code in compiled files, I'll do it; but I will not take the risk to cause regressions. I prefer to keep standard tools as it and provide customizations so if thoses syntaxes and phpSingleLine do not cover your need, please tell me you final goal. I will try to give you the best way to acheive it.
from pug.
Hi, with the new refactorized version, we will try to be as close as possible as the pug-js results for both pretty and non-pretty options but we will try to provide more customizations.
from pug.
Hi, there is a new option now available to use the native pugjs engine (until the 3.0):
$pug = new Pug(array(
'pugjs' => true
));
echo $pug->render('
span a
=" "
span b
');
This is a pure wrapper solution with no PHP support in templates (all run with node.js).
from pug.
You can update to 3.0.0-alpha2
, it should be fixed. Consecutive span are no longer affected by prettyprint option. Please don't hesitate to test the new pug-php 3 and give us your feedback.
from pug.
Related Issues (20)
- syntax error, unexpected 'idx' (T_STRING), expecting ';' HOT 1
- Support template literals HOT 1
- Undefined variable fatal error appears on quoted Vue.js variable HOT 13
- Ternary conditional operator fails with linebreak HOT 6
- read-only cache directory HOT 20
- Undefined variable when using mixin with concatenation HOT 3
- Accessing helper functions in a namespace HOT 4
- PHP 7.4 with Pug 2.7.5 minor correction HOT 3
- Compatibility problem with laracast HOT 4
- Interpolation does not support null coalescing operator HOT 4
- enable_profiler => true shows php notices (undefined index) HOT 5
- Apostrophe is escaped HOT 2
- Option to disable html minficiation HOT 1
- Bug when using combinaison of mixins with block in iteration
- Incompatibility with composer 2.0 HOT 1
- Tag Name error HOT 5
- PHP 8 support? HOT 3
- How do i convert back to HTML and keep the variable intact? HOT 1
- Deprecation warning in PHP 8.1 for null values HOT 1
- Pug 2.7.6 minor correction to avoid warning with block append usage HOT 4
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 pug.