Turn on/off pmCode globally
Posted: 12 May 2008 02:57 PM   [ Ignore ]  
Grad Student
Rank
Total Posts:  57
Joined  10-26-2007

I just bumped into an issue that rendered a whole section of Flashmagazine.com useless. Anywhere there was a code snippet showing array access, the automatic pmCode turned:

somearray[i] = something;

into this:

somearray<i> = something;

Needless to say - every tutorial using a for-loop and a variable named “i” to iterate over an array displayed half the page in italics and the code broke… It is quite common to use the letter “i”, though it’s often considered bad practice as well. The point is really that it’s no good that this is enabled by default for absolutely any Weblog field. A global on/off that defaults to “off” would be wise, though a default to “on” is probably preferred not to break existing installs.

Robin pointed me to a workaround in this thread, but a permanent fix would be better.

J

Profile
 
 
Posted: 12 May 2008 02:59 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  14038
Joined  05-15-2004

Not saying that your FR is not a valid one, but have you tried to put your snippets inside of [ code ] tags?

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 12 May 2008 03:01 PM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  57
Joined  10-26-2007

Yep. Using a <code> tag made no difference.

J

Profile
 
 
Posted: 12 May 2008 03:03 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  14038
Joined  05-15-2004

Not < code >, as in HTML, but [ code ], as in pmCode.

$somearray[i] = $foobar;

Seems to work.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 12 May 2008 03:48 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  57
Joined  10-26-2007

Right, but I don’t want to use pmCode or BB-code? I didn’t even know that EE supported it before I ran into this issue. I prefer to use either LG TinyMCE on Rich fields or plain fields with no formatting. Why should I have to even think about this (if you see my point)?

I understand that there is some heritage to pmCode and that it’s a good feature, but not make it ossible to turn it off? EE is used on many sites related to programming and odds are they won’t know that their code is mangled until somebody points it out.

J

Profile
 
 
Posted: 12 May 2008 03:50 PM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  14038
Joined  05-15-2004

I see your point, and I only suggested it as a temporary workaround until your FR gets implemented.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 12 May 2008 04:01 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Rank
Total Posts:  57
Joined  10-26-2007

Ah. Right. Sorry, I misunderstood. Just deleting the line in “core.typography.php” actually makes it easier for me since I then don’t need to type in tags.

J

Profile
 
 
Posted: 12 May 2008 04:08 PM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  14038
Joined  05-15-2004

Yes, but it’s a hack which we discourage as much as possible. But, of course, whatever works for you )

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 62613 Total Logged-in Users: 15
Total Topics: 77113 Total Anonymous Users: 14
Total Replies: 416387 Total Guests: 129
Total Posts: 493500    
Members ( View Memberlist )