import clipboard, re

text = clipboard.paste()  # text will have the content of clipboard
text = re.sub("^\s*$", "<p></p>", text)
text = re.sub("\r\n", "<br>", text)
text = re.sub("<br><br>", "<p class=\"p-text-break\"></p>", text)
# text = re.sub("<br><p>", "<p>", text)
# text = re.sub("</p><br>", "</p>", text)
clipboard.copy(text)

# "<a href=\"{}\">{}</a>".format(text, text)
a2f3ed00dde7b7e70748e83581b30cc50cefbe43
<mask token>

<mask token>
clipboard.copy(text)

<mask token>
text = clipboard.paste()
text = re.sub('^\\s*$', '<p></p>', text)
text = re.sub('\r\n', '<br>', text)
text = re.sub('<br><br>', '<p class="p-text-break"></p>', text)
clipboard.copy(text)

import clipboard, re
text = clipboard.paste()
text = re.sub('^\\s*$', '<p></p>', text)
text = re.sub('\r\n', '<br>', text)
text = re.sub('<br><br>', '<p class="p-text-break"></p>', text)
clipboard.copy(text)

import clipboard, re

text = clipboard.paste()  # text will have the content of clipboard
text = re.sub("^\s*$", "<p></p>", text)
text = re.sub("\r\n", "<br>", text)
text = re.sub("<br><br>", "<p class=\"p-text-break\"></p>", text)
# text = re.sub("<br><p>", "<p>", text)
# text = re.sub("</p><br>", "</p>", text)
clipboard.copy(text)

# "<a href=\"{}\">{}</a>".format(text, text)