diff --git a/app/src/main/java/net/gsantner/markor/ui/hleditor/HighlightingEditor.java b/app/src/main/java/net/gsantner/markor/ui/hleditor/HighlightingEditor.java index 1df9f4f62d..721e7d7b25 100644 --- a/app/src/main/java/net/gsantner/markor/ui/hleditor/HighlightingEditor.java +++ b/app/src/main/java/net/gsantner/markor/ui/hleditor/HighlightingEditor.java @@ -192,6 +192,15 @@ public void withAutoFormatDisabled(final Callback.a0 callback) { } } + @Override + public boolean onTextContextMenuItem(int id) { + // Copy-paste fix by bad richtext pasting - example text from code at https://plantuml.com/activity-diagram-beta + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && id == android.R.id.paste) { + id = android.R.id.pasteAsPlainText; + } + return super.onTextContextMenuItem(id); + } + private void cancelUpdate() { _updateHandler.removeCallbacks(_updateRunnable); }