mirror of
https://github.com/NicolasConstant/sengi
synced 2025-02-03 03:47:35 +01:00
clean up
This commit is contained in:
parent
d8f2a38e5b
commit
75cb0a1509
@ -85,9 +85,7 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
|||||||
const newLine = String.fromCharCode(13, 10);
|
const newLine = String.fromCharCode(13, 10);
|
||||||
let content = value.status.content;
|
let content = value.status.content;
|
||||||
|
|
||||||
console.warn(content);
|
|
||||||
content = this.tranformHtmlRepliesToReplies(content);
|
content = this.tranformHtmlRepliesToReplies(content);
|
||||||
console.warn(content);
|
|
||||||
|
|
||||||
while (content.includes('<p>') || content.includes('</p>') || content.includes('<br>') || content.includes('<br/>') || content.includes('<br />')) {
|
while (content.includes('<p>') || content.includes('</p>') || content.includes('<br>') || content.includes('<br/>') || content.includes('<br />')) {
|
||||||
content = content.replace('<p>', '').replace('</p>', newLine + newLine).replace('<br />', newLine).replace('<br/>', newLine).replace('<br>', newLine);
|
content = content.replace('<p>', '').replace('</p>', newLine + newLine).replace('<br />', newLine).replace('<br/>', newLine).replace('<br>', newLine);
|
||||||
@ -99,8 +97,6 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
|||||||
var dom = parser.parseFromString(content, 'text/html')
|
var dom = parser.parseFromString(content, 'text/html')
|
||||||
this.status = dom.body.textContent;
|
this.status = dom.body.textContent;
|
||||||
|
|
||||||
console.warn(this.status);
|
|
||||||
|
|
||||||
this.statusStateService.setStatusContent(this.status, this.statusReplyingToWrapper);
|
this.statusStateService.setStatusContent(this.status, this.statusReplyingToWrapper);
|
||||||
|
|
||||||
this.setVisibilityFromStatus(value.status);
|
this.setVisibilityFromStatus(value.status);
|
||||||
@ -113,17 +109,6 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
|||||||
.then((status: Status) => {
|
.then((status: Status) => {
|
||||||
let cwResult = this.toolsService.checkContentWarning(status);
|
let cwResult = this.toolsService.checkContentWarning(status);
|
||||||
this.statusReplyingToWrapper = new StatusWrapper(cwResult.status, value.provider, cwResult.applyCw, cwResult.hide);
|
this.statusReplyingToWrapper = new StatusWrapper(cwResult.status, value.provider, cwResult.applyCw, cwResult.hide);
|
||||||
|
|
||||||
// const mentions = this.getMentions(this.statusReplyingToWrapper.status, this.statusReplyingToWrapper.provider);
|
|
||||||
// for (const mention of mentions) {
|
|
||||||
// const name = `@${mention.split('@')[0]}`;
|
|
||||||
// if (this.status.includes(name)) {
|
|
||||||
// this.status = this.status.replace(name, `@${mention}`);
|
|
||||||
// } else {
|
|
||||||
// this.status = `@${mention} ` + this.status;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.notificationService.notifyHttpError(err, value.provider);
|
this.notificationService.notifyHttpError(err, value.provider);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user