开发者

drupal input filter example

开发者 https://www.devze.com 2023-01-04 10:53 出处:网络
I\'m trying to write an input filter that turns everything that starts with http and ends in .mp3 into an audio element, so:

I'm trying to write an input filter that turns everything that starts with http and ends in .mp3 into an audio element, so:

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

The regexp is no problem for me, just not sure how to construct the module.

A simple example that would allow me开发者_如何转开发 to add many additional rules would be very helpful, thanks.

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


I think you simply need to implement hook_filter() in your custom module. That page lists a detailed sample module filter_example.module.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号