Created
December 15, 2019 08:29
-
-
Save hacolab/77de3272f6ab9fdcf145dd079fe04da4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Newline mark of hatena blog | |
NEWLINE=" " | |
# Append newline mark to continue line | |
sed -e 's/$/'"${NEWLINE}"'/' \ | |
-e 's/'"${NEWLINE}${NEWLINE}"'$/'"${NEWLINE}"'/' \ | |
-e "s/^${NEWLINE}$//" \ | |
-e '/^ *[#>|]\{1,\}/s/'"${NEWLINE}"'$//' \ | |
-e '/^ *- /s/'"${NEWLINE}"'$//' \ | |
-e '/^ *[0-9]\{1,\}\. /s/'"${NEWLINE}"'$//' \ | |
-e '/^ *\[.*\] *$/s/'"${NEWLINE}"'$//' \ | |
-e '/^```/,/^```/s/'"${NEWLINE}"'$//' \ | |
| tr '\n' '>' \ | |
| sed 's/'"${NEWLINE}"'>>/>>/g' \ | |
| tr '>' '\n' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment