[REQ]Convert characters to HtmlEntities

Started by JJK, November 10, 2008, 06:03:37 PM

Previous topic - Next topic

JJK

I'm French, so I often use accentued characters. I'd like HE able to convert them into HtmlEntities.
(I use 1.4beta Unicode)


alex

Hello JKK,

Automatically when you type or as command for whole document?

Now entites should be suggested and available in completion list box (Ctrl+Space) after you have typed &.

Also (if you are using latest beta), if you hover over such accentued character, you should see corresponding entity in information tooltip window.

Best regards,
Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

JJK

Completion is not bad, but not enough for me : I prefer  to convert  selection or the whole document. So I could type my text as I type in MsWord or so, with accented letters directly, and convert all them at the end.
Nevertheless, good point.

alex

Ok, I would put this on my todo list.

But from techical point of view, I think it would be better to implement this as user script (which is not possible yet) because it is language specific action, and I dont want to make any specialization in HippoEDIT. Specialization should be done or as plugin or as user script. Both is not possible even with 1.40 beta, but I am planning to add them next versions.

Also, in addition to my previous post, you can implement such automatc conversion of specific symbols into entities with help of Code Templates, defining such characters as keys for template.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

JJK

Good news are plugins and scripts !
Waiting up for those gifts, Code Templates are also very satisfying.
Thx

Stefan

#5
FYI

other editors provide an option to use an simple text file to do such tasks.


In this text files  are an list of signs to convert,
this list use an sign as delimiter like an pipe |                    string | string

or the say this-item-of-codepage=that-item-of-codepage  code=code

-
edit:
as addition would be handy option to do conversions by using RegEx, like

SearchRegEx
ReplaceRegex
SearchRegEx
ReplaceRegex
SearchRegEx
ReplaceRegex
(\<\/?)([a-zA-Z0-9]+)(.@)\>
\1\L\2\E\3>
\<([^\<\>]#)([A-Za-z]+)\=(.@)\>
<\1\L\2\E=\3>

-


Then the editor provide an menu to list the converter-files by using the one or two description-lines of this converter files.

Then user can select some text and chose the desired converter, or execute them on the whole text.

Then the editor,i think, do an simple search and replace?


The Files look like:


; altert ASCII (DOS) char to ANSI (Windows) char and return
[Description]
;name for Left to Right conversion
Left2Right=DOS-ASCII zu Win-ANSI
;name for Right to Left conversion
Right2Left=Win-ANSI zu DOS-ASCII
;ignore char case
Left2RightIgnoreCase=0
Right2LeftIgnoreCase=0
;CharTab=0 - convertor will use string replacement from [Conversion] section
;CharTab=1 - convertor will use conversion table from [table] section
CharTab=1
;expresion from|expresion to

[Conversion]
;conversion table - char ASCII values
;you can write only used values
aliceblue|#F0F8FF
antiquewhite|#FAEBD7
aquamarine|#7FFFD4
aqua|#00FFFF
azure|#F0FFFF
beige|#F5F5DC


|%20
!|%21
"|%22
#|%23
$|%24
%|%25
&|%26



[Remove chars]
;list of ASCII values of chars to remove before conversion
;delete all section, if you don't use table conversion (CharTab=0)

[table]
; altert ASCII (DOS) char to ANSI (Windows) char and return
132=228
142=196
148=246
153=214
129=252
154=220
225=223




[Table]
;Text to ROT13
97=110
98=111
99=112
100=113





[Conversion]
;delete unwanted chars
ü|
Ü|
ö|
Ö|
ä|
Ä|
ß|
|
|
|
|
|
|
,|
ƒ|
,,|
...|
†|




;HTMLEntity1.ini
£|&pound;
¤|&curren;
¥|&yen;
¦|&brvbar;
§|&sect;
¨|&uml;
©|&copy;



EDIT: add wish for RegEx functionality
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-