@gravityforms/gulp-tasks
Version:
Configurable Gulp tasks for use in Gravity Forms projects.
32 lines (23 loc) • 622 B
JavaScript
import { Token } from './token.js';
class description extends Token {
typeText = 'description';
endCondition( text ) {
const trimmedText = text.trim();
if ( trimmedText === '' ) {
return true;
}
if ( trimmedText.startsWith( '@' ) && ! text.includes( '@description' ) ) {
return true;
}
return false;
}
tokenCondition( text ) {
return text.trim().startsWith( '@description' );
}
getContent() {
let content = this.lines.join( '\n' ).trim();
content = content.replace( /^@description\s*/, '' );
return `<div class="description"><p>${ content }</p></div>`;
}
}
export { description };