MyBB Community Forums

Full Version: Can't get custom mycode to work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I am trying to make a custom MyCode that acts as a custom video embed. It's working fine in the preview, but in an actual post, it is blank. I've boiled it down to an extremely simple mycode that still reproduces the error:

Expression:
\[x\](.*?)\[/x\]

Replacement:
<video controls>
  <source src="https://ia800701.us.archive.org/26/items/SampleVideo1280x7205mb/SampleVideo_1280x720_5mb.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

(yes I realize the replacement doesn't actually use the regular expression capture group, this is just for testing)

So when I put [x]test[/x] in the sandbox, I get a correct HTML and actual result:
[Image: nlA4ggV.png]


But if I make a new post with the exact same content:
[Image: lmdpRRZ.png]

This is a completely vanilla MyBB instance I spun up for testing, assuming one of my plugins was causing the problem, but it's not. I have tested Firefox, Edge, and Chrome from two different computers, all the same result. Really hoping someone here's knows what going on? Thanks!
Close your source tag: <source src="https://ia800701.us.archive.org/26/items/SampleVideo1280x7205mb/SampleVideo_1280x720_5mb.mp4" type="video/mp4" />
The parser is quite sensible and hates unclosed html tags Smile
(2022-09-14, 06:24 AM)Crazycat Wrote: [ -> ]Close your source tag: <source src="https://ia800701.us.archive.org/26/items/SampleVideo1280x7205mb/SampleVideo_1280x720_5mb.mp4" type="video/mp4" />
The parser is quite sensible and hates unclosed html tags Smile

That was it, thanks! It would nice if it wasn't so sensitive, w3schools makes no mention of needing to close the source tag.. HTML video Tag (w3schools.com)