Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -*- coding: utf-8 -*- 

2""" 

3 sphinxjp.themes.revealjs.compat 

4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

5 

6 :author: tell-k <ffk2005@gmail.com> 

7 :copyright: tell-k. All Rights Reserved. 

8""" 

9text = str # unicode # 

10 

11 

12def escape_html(s, quote=True): 

13 """ 

14 Replace special characters "&", "<" and ">" to HTML-safe sequences. 

15 If the optional flag quote is true (the default), the quotation mark 

16 characters, both double quote (") and single quote (') characters are also 

17 translated. 

18 """ 

19 s = s.replace("&", "&amp;") # Must be done first! 

20 s = s.replace("<", "&lt;") 

21 s = s.replace(">", "&gt;") 

22 if quote: 

23 s = s.replace('"', "&quot;") 

24 s = s.replace('\'', "&#x27;") 

25 return s