Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
Auto formatting in comments curls quotation marks in preformatted code
Posted: 08 July 2004 12:01 PM   [ Ignore ]  
Summer Student
Total Posts:  19
Joined  2003-07-22

I have pMachine’s auto-formatting off for my blog entries themselves, but it’s on for the comments that other people might add to my blog entries, so double dashes are automatically turned into em dashes, straight quotation marks and apostrophes become curled, etc.

The problem is that pMachine’s auto-formatting appears to turn straight quotation marks into curly ones even when these quotation marks are part of a block of text for which the comment’s author has used the PRE tag for preformatting purposes (usually because it’s computer code).

Clearly the quotation marks should remain straight in such cases.

Is this a bug or am I missing something?

Profile
 
 
Posted: 09 July 2004 10:01 AM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

Hm, first time this was ever brought up.  Somewhere between a bug and an unimplemented feature.  I will get to that in the next build.  Thanks.

 Signature 
Profile
 
 
Posted: 09 July 2004 12:08 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  19
Joined  2003-07-22

Cool, thanks.

Would also be cool if you could implement proper support for the CODE tag in comments. Right now, the CODE tag (used either between brackets—as pMcode—or as HTML) is equivalent to the PRE tag and forces paragraph breaks before and after. CODE should be available as an inline formatting tag, for bits of code mentioned within a paragraph of regular body text.

Profile
 
 
Posted: 09 July 2004 12:25 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

[.code] and <code> are not the same thing.  pMcode is the pMachine implementation of UBB code, which I believe has <pre> being used for [.code].  If you want to change how <pre> is used, then you can modify the tag using CSS.  Or, if you want [.code] to be converted into <code>, then you will have to modify the backend files.

 Signature 
Profile
 
 
Posted: 09 July 2004 12:54 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  19
Joined  2003-07-22

No, I want the UBB CODE tag to behave like an inline tag, i.e. not force paragraph breaks before and after. There’s nothing I can do with CSS to prevent this from happening, because pMachine converts

[.code]

to

<pre>

automatically before the CSS is applied to the page. I need pMachine to convert

[.code]

to

<code>

instead, which doesn’t make much sense. (Periods added so that the tags display properly.)

If I need to edit the backend files, I’d appreciate some pointers smile. But I really think this should be part of an official fix from pMachine. CODE is an inline tag. It shouldn’t be converted into PRE, which is a block tag.

Profile
 
 
Posted: 09 July 2004 12:55 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  19
Joined  2003-07-22

Sorry, I meant to say that what doesn’t make much sense is that pMachine is converting CODE tags into PRE tags.

Profile
 
 
Posted: 09 July 2004 01:50 PM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

What part of [.code] not equalling <code> in pMcode (and UBB code) is not coming through?  It is not a bug and does not require a fix.  Look below to see the description for its usage:  ”[.code] Any text you want pre-formatted, like PHP code or HTML [./code]”.  You want it to mean something different and, well, it does not.

Yes, you can use CSS to make <pre> act the way you want.  Try putting this in your CSS file:

pre {
    display
: inline;
    
font-family: monospace;
    
white-space: normal;
}

And if you really want to have the program use <code> instead of <pre>, then open up pmcode.fns.php and scroll down to line 322.  You should see the <pre> and [.code] on two lines in there, just switch out <pre> and put in <code>.

 Signature 
Profile
 
 
Posted: 09 July 2004 02:23 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  19
Joined  2003-07-22

OK, I’ve made the change to the pmcode.fns.php file. I still feel that this is an error in the pmcode.fns.php file that should be fixed by you guys permanently. CODE is inline and PRE is block. It makes no sense to replace [.code] with <pre>.

Plus [.code] is not documented in the on-line documentation about pMcode.

Profile
 
 
Posted: 09 July 2004 02:40 PM   [ Ignore ]   [ # 8 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  2002-08-05

Yes, by that reasoning it makes no sense to turn [.url] into <a>, [.email] into <a>, [.color=blue] into <font color=“blue”>.  [.code] is used for displaying code exactly as it should in the script or file, which requires that we use <pre>, which will allow all spacing and line breaks to be shown.  In other words, it makes perfect sense when taken into the context of the other pMcodes and the usage of this tag, and you just happen to want it different.

That is true.  It was added for forums and sites like this where an easy way to display programming or HTML code in a page, and it apparently never made it into the documentation.  I will add that for the next build as well.

 Signature 
Profile
 
 
Posted: 09 July 2004 07:38 PM   [ Ignore ]   [ # 9 ]  
Summer Student
Total Posts:  19
Joined  2003-07-22

Well, my feeling is that PRE already exists for blocks of several lines of code, so there needs to be something for inline references to code, which cannot be done with PRE. Hence the need for turning [.code] into <code>. I wouldn’t want it if I didn’t have a need for it smile.

Profile
 
 
   
 
 
‹‹ Image Uploading Errors      IP Banning Bug ››
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 233, on December 18, 2007 12:04 AM
Total Registered Members: 62653 Total Logged-in Users: 0
Total Topics: 77190 Total Anonymous Users: 0
Total Replies: 416692 Total Guests: 15
Total Posts: 493882    
Members ( View Memberlist )
Active Members: