mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-18 14:14:50 +08:00
bbcode converter preview
Signed-off-by: MiniDigger <admin@minidigger.me>
This commit is contained in:
parent
116820f85c
commit
53c67676e2
@ -216,7 +216,6 @@
|
||||
<v-tab v-text="$t('project.new.step4.tutorial')"></v-tab>
|
||||
</v-tabs>
|
||||
<v-tabs-items v-model="spigotConvertTab">
|
||||
<!-- todo spigot bbcode converter thingy -->
|
||||
<v-tab-item>
|
||||
<v-card-text>
|
||||
<v-textarea v-model="converter.bbCode" hide-details dense :rows="6" filled :label="$t('project.new.step4.convertLabels.bbCode')" />
|
||||
@ -237,7 +236,9 @@
|
||||
/>
|
||||
</v-card-text>
|
||||
</v-tab-item>
|
||||
<v-tab-item>2 </v-tab-item>
|
||||
<v-tab-item>
|
||||
<Markdown :raw="converter.markdown"></Markdown>
|
||||
</v-tab-item>
|
||||
<v-tab-item>
|
||||
<v-card-text class="text-center">
|
||||
{{ $t('project.new.step4.tutorialInstructions.line1') }}<br />
|
||||
@ -277,6 +278,7 @@ import { RootState } from '~/store';
|
||||
import { ProjectCategory } from '~/types/enums';
|
||||
import { HangarComponent } from '~/components/mixins';
|
||||
import { LoggedIn } from '~/utils/perms';
|
||||
import Markdown from '~/components/markdown/Markdown.vue';
|
||||
|
||||
interface NewProjectForm extends ProjectSettingsForm {
|
||||
ownerId: ProjectOwner['userId'];
|
||||
@ -286,6 +288,7 @@ interface NewProjectForm extends ProjectSettingsForm {
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
Markdown,
|
||||
StepperStepContent,
|
||||
},
|
||||
head: {
|
||||
|
@ -37,7 +37,7 @@ public class BBCodeConverter {
|
||||
REPLACERS.put("s", (tag, tagArg, content) -> "~~" + content + "~~");
|
||||
REPLACERS.put("img", (tag, tagArg, content) -> "![" + content + "](" + content + ")");
|
||||
REPLACERS.put("url", (tag, tagArg, content) -> {
|
||||
String url = tagArg;
|
||||
String url = tagArg == null ? content : tagArg;
|
||||
char firstCharacter = url.length() > 2 ? url.charAt(0) : '-';
|
||||
if ((firstCharacter == '\'' || firstCharacter == '\"') && url.charAt(url.length() - 1) == firstCharacter) {
|
||||
url = url.substring(1, url.length() - 1);
|
||||
|
Loading…
Reference in New Issue
Block a user