View Single Post
FWIW the iPad clipboard can indeed be transformed with something like this (run in Pythonista).

Code:
import clipboard, re

str_clip = clipboard.get()

# Translate each sequence of 4 spaces to a tab
str_clip = re.sub('    ', '\t', str_clip)
# Unbreak wrap-broken lines (look for residual spaces after tab)
str_clip = re.sub('[\r\n]+\t* ',' ', str_clip)
# Add Markdown bullets between tab and text ? iOS OmniOutliner adds them anyway ...
# str_clip = re.sub(r'^(\s*)(\S)', r'\1- \2', str_clip, flags=re.MULTILINE)
# Prune duplicate space
str_clip = re.sub(r' {2,}', r' ', str_clip)

clipboard.set(str_clip)