New line in post add br
2 posters
Page 1 of 1
New line in post add br
Technical Details
Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Mozilla Firefox, Google Chrome, Opera, Safari
Screenshot of problem : https://i.imgur.com/b34ES6z.png
Who the problem concerns : All members
Forum link : https://cadikim.forumpl.net/t11-wzor-telefonu#48
Description of problem
The enters used in the post add
|
Is there a way to fix this so that the enters do not add
|
Last edited by LeChat on September 26th 2023, 7:50 pm; edited 2 times in total (Reason for editing : Last title was confusing)
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Re: New line in post add br
The problem is, I do not use it. When I published my code, every new line in my editor add a <br>. It looks like this in editor:
The code is correct when I dont use new line in editor, but it isn't good for my users - which will be editing this code.
The code is correct when I dont use new line in editor, but it isn't good for my users - which will be editing this code.
Re: New line in post add br
Unfortunately, this is how the HTML code in the post is interpreted.
Try AP - Modules - Javascript codes management - Create a new Javascript
Title: any
Placement: In the topics
Javascript Code:
Result:
Before:
After:
Try AP - Modules - Javascript codes management - Create a new Javascript
Title: any
Placement: In the topics
Javascript Code:
- Code:
$(document).ready(function() {
document.querySelectorAll('.postbody').forEach((item) => {
item.querySelectorAll('br').remove();
});
});
Result:
Before:
After:
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Re: New line in post add br
I don't have
on my forum. I tried to replaced it with
to assign it only to this code, not entire forum, but it doesn't work. I'll try to rebuilt the code, maybe in flex, to solve this issue.
Request isn't solved, but I think we can move it to garbage.
Thanks for your help anyway.
|
|
Request isn't solved, but I think we can move it to garbage.
Thanks for your help anyway.
Re: New line in post add br
Since you keep two code display options, the br tags don't appear in the first one.
Because the code can't find the br tags in the first code, it breaks.
You need to add a check. Here is the updated code:
Result:
If your request is resolved or you wish to end the discussion, mark the topic as solved.
Because the code can't find the br tags in the first code, it breaks.
You need to add a check. Here is the updated code:
- Code:
$(document).ready(function() {
const specialElement = document.querySelectorAll('.tele_bg')
if (specialElement) {
specialElement.forEach((item) => {
const br = item.querySelectorAll('br');
if (br) {
br.forEach((item) => {
item.remove();
});
}
});
}
});
Result:
If your request is resolved or you wish to end the discussion, mark the topic as solved.
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
sivastar likes this post
Re: New line in post add br
Razor12345, thank you very much for your help! However, I realized that I was an idiot because instead of a script, I simply added this line to the code.
and everything works wonderfully.
I marked topic as solved.
|
I marked topic as solved.
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Similar topics
» How to make line on post?
» Question about Avatars on Post line on the Index
» Trying to post, preview is right but when posting is onlye one line
» How do you remove this line separating miniprofile and post body on an Invision forum?
» How to make dotted line, one full line?
» Question about Avatars on Post line on the Index
» Trying to post, preview is right but when posting is onlye one line
» How do you remove this line separating miniprofile and post body on an Invision forum?
» How to make dotted line, one full line?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum