Opened 14 years ago
Last modified 12 years ago
#556 assigned Enhancement
AS: Text to or from HTML conversion routines & functions
Reported by: | Niteshade | Owned by: | timothy |
---|---|---|---|
Component: | Colloquy (Mac) | Version: | 2.2 (Mac) |
Severity: | Normal | Keywords: | HTML text & display bug convert |
Cc: | hennk |
Description
Because Colloquy requires HTML text, it has problems displaying some normal text characters in the window (eg &) and it just sends a blank line. The text must be "converted" to HTML OK text - where e.g. & is changed to & There are a lot of other odd characters that may need to be changed because, if they are present, they will probably similarly screw up the display of the whole line.
It would be nice if there was a built in Applescript routine that can be called to translate lines of text to and from HTML. All the HTML characters would be translated - http://rabbit.eng.miami.edu/info/htmlchars.html
Maybe a more powerful version would also have the option of converting other IRC characters (eg. ctrl-b) into HTML compatible text (<b></b>)
Such a basic funtion would 1. be so useful, 2. be reliable in converting ALL troublesome characters (vs a user created routine), and 3. protect against bugs/errors in display, that I set this ticket to a high priority.
Cheers
Niteshade
Change History (7)
comment:1 Changed 14 years ago by timothy
- Status changed from new to assigned
comment:2 Changed 14 years ago by brennan@…
comment:3 Changed 14 years ago by timothy
I agree with brennan.
comment:4 follow-up: ↓ 5 Changed 13 years ago by akempgen
- Component changed from Colloquy (GUI) to AppleScript Support
there should probably two plugin functions:
one that has rich text (or plain text with irc control chars if thats not the same) as a param and return value, and is called before colloquy converts it to html and searches for member links and urls. this would also fix the issues the blowfish plugin has
and one that has html as param and return value. this would obviously called when colloquy is done converting stuff to html.
not sure if this just applies to AS or other languages as well
comment:5 in reply to: ↑ 4 Changed 13 years ago by hennk
Replying to akempgen:
there should probably two plugin functions:
one that has rich text (or plain text with irc control chars if thats not the same) as a param and return value, and is called before colloquy converts it to html and searches for member links and urls. this would also fix the issues the blowfish plugin has
I am developing a Blowfish plugin as an ObjC plugin based on the irssi-plugin from http://fish.sekure.us . I've ran into the same problems as the AS plugin (ie. no processing of the decrypted messages like nick/url detection). Another problem seems to be the encoding of the message. Right now I have to supply either an NSString or HTML, but I need a guess for the correct encoding for both.
So for encryption plugins I think the best would be to simply work on some NSData, and leave everything regarding interpreting the message up to Colloquy. This would then require a third plugin method, called even before Colloquy starts to decode the actual content of the incoming message into NSStrings or something similarly higher-level.
and one that has html as param and return value. this would obviously called when colloquy is done converting stuff to html.
not sure if this just applies to AS or other languages as well
This applies to all languages, but I am not sure about the right component. Would that be Generic Script Support, then?
comment:6 Changed 13 years ago by hennk
- Cc hennk added
comment:7 Changed 12 years ago by Brennan
/nod - yes it sounds like Generic Script Support should handle this.
For those using AppleScript?, you could do worse than
http://www.apple.com/applescript/guidebook/sbrt/pgs/sbrt.10.htm
This is certainly a problem, although I am not sure about the exact solution.
AppleScript? is quite slow when processing strings, and I would certainly argue that any special text conversions required by Colloquy (such as escaping the & character) should be handled by compiled cocoa routines.
Building a string containing HTML tags is tortuously slow. It would be good to have this handled faster somehow, but maybe it's a job for 'do shell script'.