NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
<br> shortcut


Joined: 24 Nov 2010
Posts: 21
Reply with quote
Hi, I often use Ctrl+Enter shortcut for <br> tag, but XHTML, WML & etc. standards need closed <br/> tag.
In the settings are no option for change it.

spasibo, balalaika, Lenin, matroshka, Stalin Very Happy
View user's profileFind all posts by exedSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
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. Wink
View user's profileFind all posts by plugnplaySend private message


Joined: 08 Jun 2011
Posts: 5
Reply with quote
plugnplay wrote:
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.


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.
View user's profileFind all posts by 7sedmSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
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:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head></head>
<body>
  <br />
</body>
</html>


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.
View user's profileFind all posts by plugnplaySend private message


Joined: 13 Oct 2006
Posts: 21
Reply with quote
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.
View user's profileFind all posts by SaresSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
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.
View user's profileFind all posts by plugnplaySend private message


Joined: 08 Jun 2011
Posts: 5
Reply with quote
Sares wrote:
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.


Thanks, that's it! But it appears as there is no place to set the what to use as default Sad 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.
View user's profileFind all posts by 7sedmSend private message


Joined: 24 Nov 2010
Posts: 21
Reply with quote
Thanks for help. I solve problem by Set XHTML in Main Settings->Code Insight->Settings->Target HTML Version
View user's profileFind all posts by exedSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
7sedm wrote:
and have to change manually in every project.

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
View user's profileFind all posts by dmitriSend private messageVisit poster's website
<br> shortcut
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic