diff --git a/electron/package.json b/electron/package.json index b96dd3d4a..12db79203 100644 --- a/electron/package.json +++ b/electron/package.json @@ -1,6 +1,6 @@ { "name": "postybirb", - "version": "2.3.41", + "version": "2.3.42", "description": "PostyBirb is an application that helps artists post art and other multimedia to multiple websites more quickly.", "main": "main.js", "scripts": { diff --git a/package.json b/package.json index 9946b9038..0bff51e3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postybirb", - "version": "2.3.41", + "version": "2.3.42", "scripts": { "ng": "ng", "compile": "ng build --vendor-chunk=false", diff --git a/src/app/websites/website-services/derpibooru/derpibooru.service.ts b/src/app/websites/website-services/derpibooru/derpibooru.service.ts index 1fb8b617b..f26ecb659 100644 --- a/src/app/websites/website-services/derpibooru/derpibooru.service.ts +++ b/src/app/websites/website-services/derpibooru/derpibooru.service.ts @@ -6,13 +6,13 @@ import { getTags, supportsFileType } from '../../helpers/website-validator.helpe import { getTypeOfSubmission, TypeOfSubmission } from 'src/app/utils/enums/type-of-submission.enum'; import { MBtoBytes, fileAsFormDataObject } from 'src/app/utils/helpers/file.helper'; import { Website } from '../../decorators/website-decorator'; -import { PlaintextParser } from 'src/app/utils/helpers/description-parsers/plaintext.parser'; import { DerpibooruSubmissionForm } from './components/derpibooru-submission-form/derpibooru-submission-form.component'; import { BaseWebsiteService } from '../base-website-service'; import { WebsiteStatus, LoginStatus, SubmissionPostData, PostResult } from '../../interfaces/website-service.interface'; import { SubmissionRating } from 'src/app/database/tables/submission.table'; import { BrowserWindowHelper } from 'src/app/utils/helpers/browser-window.helper'; import { Promisify } from 'src/app/utils/helpers/promisify.helper'; +import { MarkdownParser } from 'src/app/utils/helpers/description-parsers/markdown.parser'; const ACCEPTED_FILES = ['jpeg', 'jpg', 'png', 'svg', 'gif', 'webm'] @@ -36,30 +36,30 @@ function validate(submission: Submission, formData: SubmissionFormData): any[] { return problems; } -function descriptionPreparser(html: string): string { - if (!html) return ''; - - html = html.replace(//gi, '*'); - html = html.replace(//gi, '_'); - html = html.replace(//gi, '+'); - html = html.replace(//gi, '-'); - html = html.replace(/<\/b>/gi, '*'); - html = html.replace(/<\/i>/gi, '_'); - html = html.replace(/<\/u>/gi, '+'); - html = html.replace(/<\/s>/gi, '-'); - html = html.replace(//gi, '_'); - html = html.replace(/<\/em>/gi, '_'); - html = html.replace(//gi, '*'); - html = html.replace(/<\/strong>/gi, '*'); - html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); - - return html; -} - -function descriptionParser(html: string): string { - html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); - return html; -} +// function descriptionPreparser(html: string): string { +// if (!html) return ''; + +// html = html.replace(//gi, '*'); +// html = html.replace(//gi, '_'); +// html = html.replace(//gi, '+'); +// html = html.replace(//gi, '-'); +// html = html.replace(/<\/b>/gi, '*'); +// html = html.replace(/<\/i>/gi, '_'); +// html = html.replace(/<\/u>/gi, '+'); +// html = html.replace(/<\/s>/gi, '-'); +// html = html.replace(//gi, '_'); +// html = html.replace(/<\/em>/gi, '_'); +// html = html.replace(//gi, '*'); +// html = html.replace(/<\/strong>/gi, '*'); +// html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); + +// return html; +// } + +// function descriptionParser(html: string): string { +// html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); +// return html; +// } @Injectable({ providedIn: 'root' @@ -77,11 +77,8 @@ function descriptionParser(html: string): string { validators: { submission: validate }, - preparsers: { - description: [descriptionPreparser] - }, parsers: { - description: [descriptionParser, PlaintextParser.parse], + description: [MarkdownParser.parse], disableAdvertise: true, usernameShortcut: { code: 'db', diff --git a/src/app/websites/website-services/fur-affinity/components/fur-affinity-submission-form/fur-affinity-submission-form.component.html b/src/app/websites/website-services/fur-affinity/components/fur-affinity-submission-form/fur-affinity-submission-form.component.html index c4cbd151c..996a9bc34 100644 --- a/src/app/websites/website-services/fur-affinity/components/fur-affinity-submission-form/fur-affinity-submission-form.component.html +++ b/src/app/websites/website-services/fur-affinity/components/fur-affinity-submission-form/fur-affinity-submission-form.component.html @@ -1,13 +1,7 @@
- + {{ (titleInput.value || '').length }} / {{ 50 }}
@@ -26,21 +20,14 @@
{{ 'Description' | translate }}
- +
{{ 'Tags' | translate }}
- +
@@ -48,10 +35,10 @@
{{ 'Tags' | translate }}
{{ 'Disable Comments' | translate - }} + }} {{ 'Reupload better quality image' | translate - }} + }} {{ 'Scraps' | translate }}
@@ -201,17 +188,22 @@
{{ 'Tags' | translate }}
Aeromorph Angel Dragon + Avali Chakat Citra Crux Dracat Dutch Angel Dragon + Felkin Ferrin Jogauni Langurhali Nevrean Protogen Sergal + Synx + Wickerbeast + Yinglet Zorgoia @@ -582,14 +574,10 @@
{{ 'Tags' | translate }}
- +
-
+ \ No newline at end of file diff --git a/src/app/websites/website-services/furbooru/furbooru.service.ts b/src/app/websites/website-services/furbooru/furbooru.service.ts index 9318a1a65..e5a2e3136 100644 --- a/src/app/websites/website-services/furbooru/furbooru.service.ts +++ b/src/app/websites/website-services/furbooru/furbooru.service.ts @@ -6,13 +6,13 @@ import { getTags, supportsFileType } from '../../helpers/website-validator.helpe import { getTypeOfSubmission, TypeOfSubmission } from 'src/app/utils/enums/type-of-submission.enum'; import { MBtoBytes, fileAsFormDataObject } from 'src/app/utils/helpers/file.helper'; import { Website } from '../../decorators/website-decorator'; -import { PlaintextParser } from 'src/app/utils/helpers/description-parsers/plaintext.parser'; import { BaseWebsiteService } from '../base-website-service'; import { WebsiteStatus, LoginStatus, SubmissionPostData, PostResult } from '../../interfaces/website-service.interface'; import { SubmissionRating } from 'src/app/database/tables/submission.table'; import { BrowserWindowHelper } from 'src/app/utils/helpers/browser-window.helper'; import { Promisify } from 'src/app/utils/helpers/promisify.helper'; import { FurbooruSubmissionForm } from './components/furbooru-submission-form/furbooru-submission-form.component'; +import { MarkdownParser } from 'src/app/utils/helpers/description-parsers/markdown.parser'; const ACCEPTED_FILES = ['jpeg', 'jpg', 'png', 'svg', 'gif', 'webm'] @@ -36,30 +36,30 @@ function validate(submission: Submission, formData: SubmissionFormData): any[] { return problems; } -function descriptionPreparser(html: string): string { - if (!html) return ''; - - html = html.replace(//gi, '*'); - html = html.replace(//gi, '_'); - html = html.replace(//gi, '+'); - html = html.replace(//gi, '-'); - html = html.replace(/<\/b>/gi, '*'); - html = html.replace(/<\/i>/gi, '_'); - html = html.replace(/<\/u>/gi, '+'); - html = html.replace(/<\/s>/gi, '-'); - html = html.replace(//gi, '_'); - html = html.replace(/<\/em>/gi, '_'); - html = html.replace(//gi, '*'); - html = html.replace(/<\/strong>/gi, '*'); - html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); - - return html; -} - -function descriptionParser(html: string): string { - html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); - return html; -} +// function descriptionPreparser(html: string): string { +// if (!html) return ''; + +// html = html.replace(//gi, '*'); +// html = html.replace(//gi, '_'); +// html = html.replace(//gi, '+'); +// html = html.replace(//gi, '-'); +// html = html.replace(/<\/b>/gi, '*'); +// html = html.replace(/<\/i>/gi, '_'); +// html = html.replace(/<\/u>/gi, '+'); +// html = html.replace(/<\/s>/gi, '-'); +// html = html.replace(//gi, '_'); +// html = html.replace(/<\/em>/gi, '_'); +// html = html.replace(//gi, '*'); +// html = html.replace(/<\/strong>/gi, '*'); +// html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); + +// return html; +// } + +// function descriptionParser(html: string): string { +// html = html.replace(/(.*?)<\/a>/gi, '"$4":$2'); +// return html; +// } @Injectable({ providedIn: 'root' @@ -77,11 +77,8 @@ function descriptionParser(html: string): string { validators: { submission: validate }, - preparsers: { - description: [descriptionPreparser] - }, parsers: { - description: [descriptionParser, PlaintextParser.parse], + description: [MarkdownParser.parse], disableAdvertise: true, usernameShortcut: { code: 'furb',