<br> shortcut |
Guru master
|
Go into Settings > Editor > Editor Shortcuts. Near the bottom of the list of shortcuts you will find HTML tags and the first one is Ctrl+Enter for Add HTML <br>, which you can change to whatever you like.
You wrote <br/> without a space, but a recommendation for better browser compatibility is that you use <br /> with a space before the closing tag. |
||||||||||||
|
|
That function only let me change the short cut key combination, not the command as such, or add more key combinations (which I really don't understand the need for?), hence no way (in GUI at least) to change it to <br /> which IS the proper syntax and as I would like to have it too. This is on PhpED 6 (6026), bug? I also notice it comes with 2 instances of commands with duplicated shortcuts, not good. Although I cannot tell if this is a result of the update from 5.9.5, although I know I have never changed anything in this dialogue, ever. |
||||||||||||||
|
Guru master
|
Ahh, you're correct, I didn't try changing the command and you can't change it.
However, I just edited a HTML file with an XHTML 1.0 Transitonal DOCTYPE and PhpED does insert <br /> when I press ctrl+Enter:
So it appears PhpED has some 'intelligence' with br's but I'm not sure if it is correct, because the PhpED 6.0 default XHTML file template still inserts <br>. At the very least, it looks like if you adjust your HTML DOCTYPE's to something suitable, then you can get <br /> to work, at least with HTML files if not PHP files. |
||||||||||||||
|
|
Hi,
have you checked what target HTML version you have enabled under your project settings -> Parser?? HTML3.2, HTLM4 and HTML5 will use <br> all XHTML versions are using <br /> Hope that helps. |
||||||||||||
|
Guru master
|
Changing the Parser setting does have an impact on <br />, although sometimes PhpED seems to use the DOCTYPE and sometimes it does not.
If a DOCTYPE of something like XHTML 1.0 Transitional is used, then PhpED does not use the Parser setting but uses the DOCTYPE. That is correct, because an existing DOCTYPE should always be honoured. With PhpED 6 there is a new template XHTML File.html which has a default DOCTYPE of XHTML 1.1 If that DOCTYPE is used, PhpED uses the Parser setting and not the DOCTYPE. It isn't actually a problem for me because I never using ctrl+Enter to insert break's (too used to doing them manually) but I guess this behaviour may have an impact on other things such as HTML validation. Just confirmed that with the Parser setting turned off, if you create a new XHTML file (XHTML 1.1) then <br> is validated as an error, but ctrl+Enter inserts a <br> instead of a <br />, so there does appear to be a bug here but validation is maybe working correctly. It looks like a suitable combination of Parser setting and DOCTYPE should be able to work around the issue. |
||||||||||||
|
|
Thanks, that's it! But it appears as there is no place to set the what to use as default Found out mine was set to use HTML 4 but I want that to be XHTML by default, but nowhere to set that, not in menus/dialogs anyway and have to change manually in every project. |
||||||||||||||
|
|
Thanks for help. I solve problem by Set XHTML in Main Settings->Code Insight->Settings->Target HTML Version
|
||||||||||||
|
Site Admin
|
There are three things affecting the rules: -current document DTD. If you use DTD, no other settings of HTML version have any effect -setting of HTML version in the project that the HTML file belongs to. If project specific settings for parser are enabled - they have effect on the files, unless they have their own DTDs (per p1) -setting of HTML version in Tools->Settings->Code Insight->Settings->Target HTML Version. It's the last resort. |
||||||||||||||
_________________ The PHP IDE team |
<br> shortcut |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by