Active
Project:
Signatures for Forums
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2009 at 13:59 UTC
Updated:
23 Feb 2009 at 13:16 UTC
Now we have to put in BR tags for line breaks. The "Line limit:" feature then count's this line break tags and based on that it calculates number of lines?
I was thinking if it could be done like this. User would input lines with "enter key" press and then we could use custom filter with defoult "Line break converter" option enabled to convert "carriage return" to < br > tags.
But i don't know how hard or if it is evan possible to make it to work like that..
Comments
Comment #1
liam mcdermott commentedI'm not sure what you're asking for here. The line limit feature works by counting line breaks in the signature text, not by counting
<br />tags. The code is:which you can see on line 299 of signature_forum.module, in the 6 -dev branch. Maybe it already works the way you expect? :)
Comment #2
Ledo2 commentedThere was a problem. I tested too quickly and we both are right in one part but still we both are "wrong" in one part.
To explain:
It has to do with the "carriage return" producing "soft return" \n or "hard return" \r. In FF browsers pressing enter key produces "soft return" \n but in IE pressing enter key produces "hard return" \r. In IE for the line counting feature to work
We must press Shift + enter to get "soft return". So in IE if user puts in more lines than we set with just enter key the above code will not count it like lines.
Comment #3
liam mcdermott commentedI just tested this in IE and it did count the returns.
There is a problem with what the feature says it does vs. what it actually does though: it's counting returns, instead of the number of lines. So, a signature with two lines of text would be counted as having one return (which is a bug and should be fixed). Maybe this is what's tripping you up?
Comment #4
Ledo2 commentedWe are getting there i think. Try this:
Set:
To let say number 3.
Then in any browser input:
line1
line2
line3
Works fine.
then try:
line1
line2
line3
line4
Works too.
line1
line2
line3
line4
line5
To many lines error.
So bottom line when i first tested this module i put in 4 lines of text in for test. I thought in IE line limit didn't work at all. I assumed it has to to something with hard return. If i would use 5 lines then instead of 4 for testing i probbably would not noticed this at all.
But now i see it works in both browsers the same just number of lines allowed +1 extra line. So this is i think the bottom line of this "feature request". Module allows 1 line of signature more then we set and that now i see confused me of thinking line count didn't work in IE.
Comment #5
liam mcdermott commentedChanging status and title. It's not a feature request, because the module should do what you are asking for, I just didn't think the logic through well-enough. :)
Comment #6
Ledo2 commentedAll's Well That Ends Well. ;)