MCPcopy Create free account
hub / github.com/clips/pattern / _subMSChar

Method _subMSChar

pattern/web/soup/BeautifulSoup.py:1803–1812  ·  view source on GitHub ↗

Changes a MS smart quote character to an XML or HTML entity.

(self, orig)

Source from the content-addressed store, hash-verified

1801 if not u: self.originalEncoding = None
1802
1803 def _subMSChar(self, orig):
1804 """Changes a MS smart quote character to an XML or HTML
1805 entity."""
1806 sub = self.MS_CHARS.get(orig)
1807 if isinstance(sub, tuple):
1808 if self.smartQuotesTo == 'xml':
1809 sub = '&#x%s;' % sub[1]
1810 else:
1811 sub = '&%s;' % sub[0]
1812 return sub
1813
1814 def _convertFrom(self, proposed):
1815 proposed = self.find_codec(proposed)

Callers 1

_convertFromMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected