Skip to content

Instantly share code, notes, and snippets.

// Javascript bookmarklet to decode old texts with encoding problems
// between Windows 1252 and utf-8
// Intended to be used as a bookmarklet
var ct=[
{"c":"€","ch":"€"},
{"c":"Â\x81","ch":"\x81"},
{"c":"‚","ch":"‚"},
{"c":"Æ’","ch":"ƒ"},
{"c":"„","ch":"„"},
@HeirOfNorton
HeirOfNorton / criticpandoc.py
Created December 13, 2014 20:09
Pandoc filter to convert Critic Markup to Spans (which will be converted to Tracked Changes in Docx).
#!/usr/bin/env python
"""
Pandoc filter to parse CriticMarkup into Spans for
Insertion and Deletion. The Docx writer will convert
these into Tracked Changes.
A comment immediately after a change will be parsed
for "author: The Author" and "date: 12-21-12", which
will be inserted into the Span as appropriate.
@HeirOfNorton
HeirOfNorton / span2critic.py
Created December 13, 2014 20:05
Pandoc filter to convert Tracked Changes (in docx reader) to CriticMarkup
#!/usr/bin/env python
"""
Pandoc filter to convert Tracked Changes in docx
input to CriticMarkup in the output.
"""
from pandocfilters import toJSONFilter, Str, RawInline
def findValue (which, items):