Saves an HTML segment for later reinsertion. Returns a placeholder string that needs to be inserted into the document. Keyword arguments: * html: an html segment * safe: label an html segment as safe for safemode Returns : a placeholder st
(self, html, safe=False)
| 50 | self.rawHtmlBlocks=[] |
| 51 | |
| 52 | def store(self, html, safe=False): |
| 53 | """ |
| 54 | Saves an HTML segment for later reinsertion. Returns a |
| 55 | placeholder string that needs to be inserted into the |
| 56 | document. |
| 57 | |
| 58 | Keyword arguments: |
| 59 | |
| 60 | * html: an html segment |
| 61 | * safe: label an html segment as safe for safemode |
| 62 | |
| 63 | Returns : a placeholder string |
| 64 | |
| 65 | """ |
| 66 | self.rawHtmlBlocks.append((html, safe)) |
| 67 | placeholder = HTML_PLACEHOLDER % self.html_counter |
| 68 | self.html_counter += 1 |
| 69 | return placeholder |
| 70 | |
| 71 | def reset(self): |
| 72 | self.html_counter = 0 |