Salve a tutti,
per tenere un pò il passo con i tempi, ho deciso di fornire ai miei clienti un campo di testo (per modificare i testi nel sito) con un richtext.
Capita però ogni tanto il cliente che addirittura ci trascina dentro un file (non so come faccia) o altre cavolate.
In sostanza, mi ritrovo ad avere delle stringhe come questa:
codice:
Descrizione, testo contenuto. Questa è una prova.<div><span class="Apple-style-span" style="font-family: `Times New Roman`; font-size: medium; "><div style="font-family: Verdana; font-size: 11px; background-color: rgb(255, 247, 217); ">Descrizione, testo contenuto.Questa è una prova.</div><div style="font-family: Verdana; font-size: 11px; background-color: rgb(255, 247, 217); "><span class="Apple-style-span" style="font-family: `Times New Roman`; font-size: medium; "><div style="font-family: Verdana; font-size: 11px; background-color: rgb(255, 247, 217); ">Descrizione, testo contenuto.Questa è una prova.</div></span></div></span></div>
o questa (che credetemi non so come abbia potuto generarla):
codice:
<div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><span style="font-style: italic;">[img]webkit-fake-url://71977F40-65E7-4A6E-8817-DCDB4CE4CBF4/application.pdf[/img]</span></span></font></div>
VORREI FORMATTARE QUESTE STRINGHE, AFFINCHE' SCOMPAIANO TUTTTTTTTTI I TAG, AD ECCEZIONE DI BOLD, ITALIC E UNDERLINE.
Capita, incollando il testo da word, ad esempio, che prelevi quel carattere utilizzato.
Qualcuno sa aiutarmi?
Grazie in anticipo.