~teejee2008/timeshift/trunk

« back to all changes in this revision

Viewing changes to src/Utility/TeeJee.Misc.vala

  • Committer: Tony George
  • Date: 2016-10-05 06:56:05 UTC
  • Revision ID: tony.george.kol@gmail.com-20161005065605-xhm9kcr7twp3b3ib
Disabled ionice options

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
                return new_txt;
182
182
        }
183
183
        
184
 
        public string escape_html(string html){
185
 
                return html
186
 
                .replace("&","&")
187
 
                .replace("\"",""")
188
 
                //.replace(" "," ") //pango markup throws an error with  
189
 
                .replace("<","&lt;")
190
 
                .replace(">","&gt;")
191
 
                ;
 
184
        public string escape_html(string html, bool pango_markup = true){
 
185
                string txt = html;
 
186
 
 
187
                if (pango_markup){
 
188
                        txt = txt
 
189
                                .replace("\\u00", "")
 
190
                                .replace("\\x"  , ""); 
 
191
                }
 
192
                else{
 
193
                        txt = txt
 
194
                                .replace(" ", "&nbsp;");  //pango markup throws an error with &nbsp;
 
195
                }
 
196
                
 
197
                txt = txt
 
198
                                .replace("&" , "&amp;")
 
199
                                .replace("\"", "&quot;")
 
200
                                .replace("<" , "&lt;")
 
201
                                .replace(">" , "&gt;")
 
202
                                ;
 
203
 
 
204
                return txt;
192
205
        }
193
206
 
194
207
        public string unescape_html(string html){