In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how js handles page editor escape, remove escape, remove HTML tags of the rules, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!
HTML tags generated by a rich text editor, escaped, and then written to the database to prevent script injection:
Function htmlEncode (value) {return $('') .text (value). Html ();}
1. The escaped HTML tag content taken from the database has to be removed first, and then the HTML tag is removed, which is to generate abbreviated text.
/ * remove the HTML tag code * / function removeHTMLTag (str) {str=str.replace (/] * > / GMagneur'); / / remove HTML tag str=str.replace (/ [|] *\ nAccording to gMagol'\ n'); / / remove the white space at the end of the line / / str=str.replace (/\ n [\ s | |); / / remove extra blank lines str=str.replace (/ / ig,'') / / remove return str;} / / replace it with normal characters function escape2Html (str) {var arrEntities= {'lt':'','nbsp':'', 'amp':'&','quot':''}; return str.replace (/ & (lt | gt | nbsp | amp | quot); / ig,function (all,t) {return arrEntities [t];});}
If it is the details page of the article, you can directly remove the escape and display it on the page:
/ / replace the ideographic character function escape2Html (str) {var arrEntities= {'lt':'','nbsp':'', 'amp':'&','quot':' "'}; return str.replace (/ & (lt | gt | nbsp | amp | quot); / ig,function (all,t) {return arrEntities [t];});}
2. JS regular filter (remove) FONT-SIZE tags in rich text editor
Var test=test.replace (/ font-size:\ Whitehorse / raceme / gamma')
3. Js process removes the html, style of rich text editing, and displays only plain text content for use by list pages
Var description ='1. Income Analysis of International Insurance Brokerage Industry
The global insurance brokerage market grew from US $43.756 billion in 2010 to US $58.13 billion in 2015.
Market size of the international insurance brokerage industry in 2010-2015: us $100 million
two。 Analysis on M & An of International Insurance Brokerage Industry
Mergers and acquisitions of insurance brokers are more frequent, the number of mergers and acquisitions in 2011 is 351, and shows a growing trend. A wave of mergers and acquisitions in the insurance industry is sweeping markets around the world. For example, Italian investment group Exor acquired reinsurance company PartnerRe, Tower Wyatt and Willis Group, Willis and French insurance brokerage company GrasSavoye, Swiss insurance group ACE acquired Chubb and American insurance company Anthem acquired Cigna. These are just a small part of the list of mergers and acquisitions in the insurance industry in recent years.
However, behind the bustling news of mergers and acquisitions is a harsh reality. BCG analyzed 778 mergers and acquisitions involving the insurance industry between 1990 and 2014, tracked total shareholder returns within a year after mergers and acquisitions, and found that only 51 per cent of mergers and acquisitions actually created value, while 49 per cent destroyed the value of the company. Nearly half of the M & A failures can be attributed to three major reasons: M & A preparation and execution, post-M & An integration and M & A timing.
3. The insurance industry continues to integrate.
Over the next five years, a number of macro factors will continue to drive the consolidation of the insurance industry. First of all, regulation will continue to be tightened, especially the capital adequacy requirements will continue to rise, both independent insurers and integrated groups will feel greater financial pressure. Interest rates and investment returns will remain low (at least in mature markets), limiting the profitability of the traditional life insurance business.
In addition, the threat of emerging competitors is not to be underestimated, and even large supermarket chains and telecom companies have the potential to upend the value chain of the insurance industry. These companies not only have priceless consumer data, but also have "last mile" connections with customers. Under the new operation mode, it is difficult for traditional insurance companies to control the whole value chain, and it is easy to become the subversive target of the new business model. For example, some network aggregation search products can provide consumers with price transparent product comparison.
Large, cash-rich insurers can use investment to fend off the threat of innovation, while medium-sized companies that focus only on internal operations and turn a blind eye to external changes will face fiercer competition. It is a vital ability for insurance companies to understand consumer behavior and needs, but the cost of building the necessary big data technology, culture and team is too large for smaller insurers to bear. For insurance companies, the opportunities for organic growth are very limited. Mature markets have entered the integration cycle, although there are development opportunities in emerging markets, but the market environment is very complex. To form economies of scale in new markets, mergers and acquisitions are obviously still a wise choice for major insurance companies.
The proportion of international business of the top ten insurance brokerage companies in the world
4. Profit level of international insurance brokerage industry
At present, the income of the global insurance brokerage industry reached 58.13 billion US dollars in 2015, and the profit level of the international insurance brokerage industry remains between 1025% and 25%.
'; description = description.replace (/ (\ n) / g, "); description = description.replace (/ (\ t) / g,"); description = description.replace (/ (\ r) / g,"); description = description.replace (/] * > / g,"); description = description.replace (/\ splasticalg,"); console.log (description)
4. JQuery JavaScript regular expressions and\ ninstead of
Lee TaylorTeneff gives a way to deal with the problem:
Var str = document.getElementById ('mydiv') [xss_clean]
Document.getElementById ('mytextarea') [xss_clean] = str.replace (/ / gi, "\ n")
Or using jQuery:
Var str = $("# mydiv") .html ()
Var regex = / / gi
$("# mydiv") .html (str.replace (regex, "\ n"))
5. Remove html tags, pictures, line feeds, carriage returns, etc.
Description = description.replace (/ (\ n) / g, ""); description = description.replace (/ (\ t) / g, ""); description = description.replace (/ (\ r) / g, ""); description = description.replace (/] * > / g, ""); description = description.replace (/\ sharmplagg, "")
6. A small write to replace the excess br in fackeditor with the blank line
/ / strengthening replacement is mainly to consider the problem of multiple br function doRepAdvance (s) {var str=s.replace (/
/ ig, ""); str=str.replace (/\ n / ig, "
"); str=str.replace (/\ n/ig,"
); str=str.replace (/\ n\ r/ig, "
); str=str.replace (/ / ig, "
"); str=str.replace (/\ n / ig,"
"); str=str.replace (/
\ n / ig, "
"); str=str.replace (/\ n/ig,"
); str=str.replace (/\ n\ r/ig, "
"); str=str.replace (/ (
\ n) {1,} / ig, "
"); str=str.replace (/ (
) {1,} / ig, "
"); str=str.replace (/
\ n/ig, "
"); str=str.replace (/
/ ig, "
"); str=str.replace (/
/ ig, ""); str=str.replace (/
/ ig, ""); str=str.replace (/
/ ig, ""); str=str.replace (/
/ ig, "); return str;} above is all the content of this article entitled" how js handles page editor escape, remove escape, remove HTML tag rules ". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.