liquidlight / typo3-shortcodes

Wordpress-style shortcodes for TYPO3
https://extensions.typo3.org/extension/shortcodes
3 stars 1 forks source link

Use video-id instead of the full URL #10

Closed nostadt closed 2 years ago

nostadt commented 2 years ago

Summary / problem to solve

Currently the full URL has to be used. If there is no space between the URL and closing ] and you hit space, or just enter the CKEditor will make the URL clickable and therefore the parsing does not work anymore.

Example

[vimeo: https://vimeo.com/397673759]

Now, when placing the cursor after ] followed by pressing space you will receive the following result:

typo3-shortcode-example

And here's the HTML that will be generated:

<p>[vimeo: <a href="https://vimeo.com/397673759]">https://vimeo.com/397673759]</a>&nbsp;</p>

In FE it looks like this:

image

Instead I suggest following:

In my setup it worked fine.

[vimeo: 397673759]

Of course the URL will need to be provided in the PHP class that takes care of the replacement.

Specific project use-cases

Any kind of project IMO.

Blockers

Not that I can think of.

More details, logs and/or screenshots

TYPO3 version: v10

typo3-shortcodes: v1.2.2

nostadt commented 2 years ago

To avoid BC, the video-id could be configured as an additional allowed value.

nostadt commented 2 years ago

Oh, this actually works already.

mikestreety commented 2 years ago

@nostadt Hey, i'm so sorry I missed this, i don't seem to have notifications turned on - glad you figured it out & i'm so happy to see someone else using it!

nostadt commented 2 years ago

No problem. Haha, it's indeed valuable. The customer wanted to paste the source code directly into the CKEditor 👀. Luckily you have this solution at hand. So it was easier to talk him out of his initial idea.

mikestreety commented 2 years ago

@nostadt If they do want to paste the URL, they just need to make sure there is a space between that and the ] - the shortcodes EXT will strip the A tag and process the URL as expected (see the "Usage" section ⚠️ - https://github.com/liquidlight/typo3-shortcodes#usage )