File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/components/zero/dbclick Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import cryptor from "../cryptor"
22import FloatAlert from "./float-alert"
33import $ = require( 'jquery' )
44import AbstractDomDecryptor from "./abstract-dom-decryptor"
5+ import { CIPHER_ATTR_NAME } from "."
6+
57
68export default class DefaultDecryptor extends AbstractDomDecryptor {
79 private static ELE_TYPES_2_LISTEN = [ 'span' , 'p' , 'pre' ]
@@ -22,7 +24,7 @@ export default class DefaultDecryptor extends AbstractDomDecryptor {
2224 private addListener ( selecotor : JQuery ) {
2325 const _this_ = this
2426 selecotor . filter ( ( index : number , el : HTMLElement ) => {
25- const support = cryptor . support ( el . innerText )
27+ const support = el . hasAttribute ( CIPHER_ATTR_NAME ) || cryptor . support ( el . innerText )
2628 if ( support && ! super . hasMarked ( el ) ) {
2729 super . mark ( el )
2830 }
Original file line number Diff line number Diff line change @@ -3,6 +3,13 @@ import AbstractDomDecryptor from "./abstract-dom-decryptor";
33import DefaultDecryptor from "./default-decryptor" ;
44import WeiboDecryptor from './weibo-decryptor'
55
6+ /**
7+ * Mark the ciphertext element with attr.
8+ *
9+ * @since 1.4.0
10+ */
11+ export const CIPHER_ATTR_NAME = 'make-zero-ciphertext'
12+
613/**
714 * Show the float button while the user moves its mouse on <p> tags within ciphertexts
815 * @author zhy
You can’t perform that action at this time.
0 commit comments