Drupal input filter example

I am trying to write an input filter that turns everything that starts with http and ends with .mp3 into an audio element, therefore:

http://google.com/file.mp3<audio src='http://google.com/file.mp3' />

Regular expression is not a problem for me, just not sure how to build a module.

A simple example that would allow me to add many additional rules would be very helpful, thanks.

I know about a custom filter module, but it has quite a lot of overhead.

+3
source share
1 answer

I think you just need to implement hook_filter () in your custom module. This page provides a detailed example filter_example.module module .

+6
source

Source: https://habr.com/ru/post/1751610/


All Articles