Fix [header][collapse][/header]

This commit is contained in:
Mr. Stallion 2021-03-21 16:27:43 -05:00
parent 88ad750d94
commit 0b5b005d91
3 changed files with 50 additions and 2 deletions

36
bbcode/Tester.vue Normal file
View File

@ -0,0 +1,36 @@
<template>
<div>
<textarea v-model="code">
</textarea>
<bbcode :text="code"></bbcode>
</div>
</template>
<script lang="ts">
import * as _ from 'lodash';
import { Component } from '@f-list/vue-ts';
import Vue from 'vue';
import { BBCodeView } from './view';
import { StandardBBCodeParser } from './standard';
const standardParser = new StandardBBCodeParser();
@Component({
components: {
bbcode: BBCodeView(standardParser)
}
})
export default class BBCodeTester extends Vue {
code = '[center][heading][collapse=Testing Collapse][url=https://google.com/]This is a link [/url][/collapse][/heading][/center]'
}
</script>
<style lang="scss">
</style>

View File

@ -50,7 +50,7 @@ export class StandardBBCodeParser extends CoreBBCodeParser {
this.addTag(new BBCodeSimpleTag('small', 'span', ['smallText'], ['url', 'i', 'u', 'b', 'color', 's']));
this.addTag(new BBCodeSimpleTag('sub', 'span', ['smallText'], ['url', 'i', 'u', 'b', 'color', 's']));
this.addTag(new BBCodeSimpleTag('indent', 'div', ['indentText']));
this.addTag(new BBCodeSimpleTag('heading', 'h2', [], ['url', 'i', 'u', 'b', 'color', 's', 'big', 'sub']));
this.addTag(new BBCodeSimpleTag('heading', 'h2', [], ['collapse', 'justify', 'center', 'left', 'right', 'url', 'i', 'u', 'b', 'color', 's', 'big', 'sub']));
this.addTag(new BBCodeSimpleTag('row', 'div', ['row']));
this.addTag(new BBCodeCustomTag('col', (parser, parent, param) => {
const col = parser.createElement('div');

View File

@ -11,6 +11,8 @@
<i class="fas fa-circle-notch fa-spin search-spinner"></i>
</div>
<BBCodeTester v-show="false"></BBCodeTester>
<h3 class="card-header" style="margin-top:0;display:flex">
{{l('title')}}
@ -133,6 +135,9 @@
import * as SlimcatImporter from './importer';
import _ from 'lodash';
import { EventBus } from '../chat/preview/event-bus';
import BBCodeTester from '../bbcode/Tester.vue';
// import Bluebird from 'bluebird';
// import Connection from '../fchat/connection';
// import Notifications from './notifications';
@ -184,7 +189,14 @@
log.info('init.chat.keytar.load.done');
@Component({
components: {chat: Chat, modal: Modal, characterPage: CharacterPage, logs: Logs, 'word-definition': WordDefinition}
components: {
chat: Chat,
modal: Modal,
characterPage: CharacterPage,
logs: Logs,
'word-definition': WordDefinition,
BBCodeTester: BBCodeTester
}
})
export default class Index extends Vue {
showAdvanced = false;