GetAsCSS ( テキスト ) で取得したHTMLユニコードを文字列に変換

 Sample input(入力例):
<span style="" >&#12354;&#12356;&#12358;&#12360;&#12362;<br/>ABCDE<br/></span>

Sample output(出力例):
<span style="" >あいうえお<br/>ABCDE<br/></span>

FileMaker Pro 18 以降

function(関数):
Sample input(入力例):
Sample output(出力例):
formula(式):

While ( 
    [ 
	~css=string;
	~result=""
    ] ; 
    not IsEmpty ( ~css ) ; 
    [
	~p=Position ( ~css ; "&#" ; 1 ; 1 );
	~result=Case ( ~p=0  ; ~result & ~css; ~result & Left ( ~css ; ~p-1 ) );
	~css=Case ( ~p=0 ; ""; Middle ( ~css ; ~p ; Length ( ~css )-~p+1 ));
	~code=Middle ( ~css ; 3 ; Position ( ~css ; ";" ; 1 ; 1 )-3 );
	~string=Case ( Left (~css ; 2 ) = "&#" ; Char ( ~code) ; "" );
	~result=~result &  ~string;
	~css=Middle ( ~css ; Length ( ~code )+4 ; Length ( ~css )-Length ( ~code )+3)
    ] ;
    ~result
)