[Phpmyadmin-devel] about the "\n"
dieter.adriaenssens at gmail.com
Fri May 4 18:23:10 CEST 2012
2012/5/4 Marc Delisle <marc at infomarc.info>:
> Le 2012-05-04 11:17, Dieter Adriaenssens a écrit :
>> 2012/5/4 Marc Delisle <marc at infomarc.info>:
>>> Le 2012-05-04 07:32, Michal Čihař a écrit :
>>>> Dne Fri, 27 Apr 2012 09:26:43 -0400
>>>> Marc Delisle <marc at infomarc.info> napsal(a):
>>>>> When touching a piece of code, if you see a "\n" generated for HTML,
>>>>> it's pretty much safe to remove it (if proven otherwise, we'll build a
>>>>> wiki page documenting those cases).
>>>>> The reason was to generate more readable HTML code; now that we
>>>>> (hopefully) use Firebug to look at the generated HTML, these "\n" are no
>>>>> longer needed.
>>>> I don't have strong opinion on this. The preferred solution to this
>>>> problem for me would be using templates, where the indentation and new
>>>> lines come basically for free.
>>> Since we are not switching to templates for version 4.0, our GSoC
>>> students will need a more precise guideline about this.
>>> I continue to think that it's too much work to manually generate proper
>>> indenting of generated HTML, and that having proper indentation was more
>>> an issue before Firefox / Firebug.
>> I agree that it is too much work to review all the current generated
>> HTML to have clean indentation and line breaks, but if new HTML
>> generating code is added, it's not much effort to add a "\n" in the
>> appropriate places.
> This would not take care of the indentation, which is very important
> IMO. At least, in Firebug I watch indentation a lot.
Yes, I know. But having the newlines would give some kind of structure
to the HTML.
Getting indentation right is very difficult because you don't always
know the level of indentation of the surrounding tags, especially when
generating HTML in a function or class, because there is no context.
Unless a framework or templating engine is used that generates all the
HTML, like Michal mentioned.
>> This will cause of course cause inconsistency in the generated HTML
>> code (some will have line breaks, other will not), but that is the
>> case already.
>> So the question is, in the long term, do we want properly indented
>> generated HTML code, or completely unindented HTML?
> I prefer completely unindented HTML (those who want to see it indented
> only have to use the proper browser(s) ).
I prefer structured html (indented or having just newlines), but you
have a point about the firebug tool.
More information about the Developers