By using this plugin we can convert normal text to HTML feed like Facebook and with links and Encoded format to avoid XSS attack. This plugin was inspired by jquery-linkify plugin and XSS prevention cheat sheet
Features :
- Converting URL's to Links
- Add user link to the words specified as '@...'
- Add search links to the words specified as '#...'
- Encode data to display as HTML to avoid XSS attack
How it works ? :
- Converts http://www.google.com -- to -- http://www.google.com
- Converts @SodhanaLibrary --to-- @SodhanaLibrary
- Converts #jQuery --to-- #jQuery
- Converts admin@sodhanalibrary.com --to-- admin@sodhanalibrary.com
- Encrypts & to &
- Encrypts < to <
- Encrypts > to >
- Encrypts " to "
- Encrypts ' to '
Installation :
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.3.js'></script> <script type='text/javascript' src='/js/jQuery.feedify.js'></script>
Usage :
var text = 'Hi my twitter account is @SodhanaLibrary #Contact me at admin@sodhanalibrary.com <script>alert("hi")</script>'; var feedified= $.feedify(text);
The output will be
Hi my twitter account is @SodhanaLibrary #Contact me at admin@sodhanalibrary.com <script>alert("hi")</script>
Disable Features :
If you don't want to search hash links then you can disable it
var text = "i like #jQuery"; var options = { hash: false } var feedified = $.feedify(text, options);
Add your own regular expressions to replace Text pattern :
var text = "My name is srinivas and i was born on 1990/08/25"; var options = { dates: { regex: /(^|\s)(\d{4})([- /.])(\d{2})([- /.])(\d{2})/i, template: '$1<span class="date">$6-$4-$2</span>' } } var feedified = $.feedify(text, options);
The output will be :
My name is srinivas and i was born on 26-08-1990
Good post i am pretty much pleased with your good post.You put really very helpful information
ReplyDeleteคาสิโนออนไลน์ที่น่าเชื่อถือและมีความเป็นมืออาชีพที่สุดในตอนนี้
โปรโมชั่นGclub ของทางทีมงานตอนนี้แจกฟรีโบนัส 50%
เพียงแค่คุณสมัคร สล็อตออนไลน์ กับทางทีมงานของเราเพียงเท่านั้น
ร่วมมาเป็นส่วนหนึ่งกับเว็บไซต์คาสิโนออนไลน์ของเราได้เลยค่ะ
สมัครสล็อตออนไลน์ >>> Goldenslot
สนใจร่วมสนุกกับ คาสิโนออนไลน์ คลิ๊กได้เลย
มีทั้งคาสิโนออนไลน์ หวยออนไลน์ ฟุตบอลออนไลน์ สล็อตออนไลน์ และอื่นๆอีกมากมาย