Javascript RegEx replacing " -


i'm trying patch drupal panels module fix this nasty issue, makes ajax errorhandler unreadable. error handler has this:

// replace &lt; , &gt; < , >   error_text = error_text.replace("/&(lt|gt);/g", function (m, p) {      return (p == "lt")? "<" : ">";   }); 

i've tried 2 approaches:

adding

// replace &quot ' readability, goodness sakes, per   // http://drupal.org/node/1124042   error_text = error_text.replace(/&quot;/g, "'"); 

modifying

// replace &lt; , &gt; < , >   error_text = error_text.replace("/&(lt|gt|quot);/g", function (m, p) {      return (p == "lt")? "<" : (p == "gt") ? ">" : "'";   }); 

yet neither has worked. little help?

edit: when printed out console (in ff4 or chrome) html entities not shown. resulting alert(""), however, looks so:

an error occurred @ /home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center.  error description: [ { &quot;command&quot;: &quot;settings&quot;, &quot;argument&quot;: {    &quot;basepath&quot;: &quot;/home/&quot;, &quot;admin_menu&quot;: { &quot;margin_top&quot;: 1 }, &quot;asu_webauth&quot;: { &quot;callapp&quot;: >&quot;home&quot;, quot;onlogouturl&quot;: &quot;http://physics-dev.asu.edu&quot; } } }, { &quot;command&quot;: &quot;css_files&quot;, &quot;argument&quot;: [ { &quot;file&quot;: &quot;/home/modules/node/node.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/modules/system/defaults.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/modules/system/system.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/modules/system/system-menus.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/modules/user/user.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/admin_menu/admin_menu.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/cck/theme/content-module.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/ctools/css/ctools.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/date/date.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/filefield/filefield.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/office_hours/office_hours.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/og/theme/og.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/panels/css/panels.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/views_slideshow.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/misc/farbtastic/farbtastic.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/calendar/calendar.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?e&quot;, &quot;media&quot;: &quot;all&quot; }, { &quot;file&quot;: &quot;/home/sites/all/modules/views/css/views.css?e&quot;, &quot;media&quot;: &quot;all&quot; } ] }, { &quot;command&quot;: &quot;scripts&quot;, &quot;argument&quot;: [ &quot;/home/misc/jquery.js&quot;, &quot;/home/misc/drupal.js&quot;, &quot;/home/sites/all/modules/admin_menu/admin_menu.js&quot;, &quot;/home/sites/all/modules/og/og.js&quot;, &quot;/home/sites/all/modules/panels/js/panels.js&quot;, &quot;/home/sites/all/modules/views_slideshow/js/jquery.cycle.all.min.js&quot;, &quot;/home/sites/all/modules/views_slideshow/contrib/views_slideshow_singleframe/views_slideshow.js&quot;, &quot;/home/sites/all/modules/views_slideshow/contrib/views_slideshow_thumbnailhover/views_slideshow.js&quot;, &quot;/home/sites/all/modules/asu_webauth/asu_webauth.js&quot; ] }, { &quot;command&quot;: &quot;modal_display&quot;, &quot;title&quot;: &quot;add content center&quot;, &quot;output&quot;: &quot;\x3cdiv class=\&quot;panels-add-content-modal\&quot;\x3e\x3cdiv class=\&quot;panels-section-column panels-section-column-categories\&quot;\x3e\x3cdiv class=\&quot;inside\&quot;\x3e\x3cdiv class=\&quot;panels-categories-box\&quot;\x3e\x3ca href=\&quot;/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/activity\&quot; class=\&quot;ctools-use-ajax panels-modal-add-category\&quot; title=\&quot;\&quot;\x3eactivity\x3c/a\x3e\x3ca href=\&quot;/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/menus\&quot; class=\&quot;ctools-use-ajax panels-modal-add-category\&quot; title=\&quot;\&quot;\x3emenus\x3c/a\x3e\x3ca href=\&quot;/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/miscellaneous\&quot; class=\&quot;ctools-use-ajax panels-modal-add-category\&quot; title=\&quot;\&quot;\x3emiscellaneous\x3c/a\x3e\x3ca href=\&quot;/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/page-elements\&quot; class=\&quot;ctools-use-ajax panels-modal-add-category\&quot; title=\&quot;\&quot;\x3epage elements\x3c/a\x3e\x3ca href=\&quot;/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/view-panes\&quot; class=\&quot;ctools-use-ajax panels-modal-add-category\&quot; title=\&quot;\&quot;\x3eview panes\x3c/a\x3e\x3ca href=\&quot;/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/views\&quot; class=\&quot;ctools-use-ajax panels-modal-add-category\&quot; title=\&quot;\&quot;\x3eviews\x3c/a\x3e\x3ca href=\&quot;/home/panels/ajax/editor/select-content/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/widgets\&quot; class=\&quot;ctools-use-ajax panels-modal-add-category\&quot; title=\&quot;\&quot;\x3ewidgets\x3c/a\x3e\x3c/div\x3e\x3cdiv class=\&quot;content-type-button clear-block\&quot;\x3e\x3ca href=\&quot;/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/node/node\&quot; class=\&quot;ctools-use-ajax panels-modal-add-config\&quot; title=\&quot;add node site content.\&quot;\x3e\x3cimg src=\&quot;/home/sites/all/modules/ctools/plugins/content_types/node/icon_node.png\&quot; alt=\&quot;\&quot; title=\&quot;\&quot; width=\&quot;16\&quot; height=\&quot;16\&quot; /\x3e\x3c/a\x3e\x3cdiv\x3e\x3ca href=\&quot;/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/node/node\&quot; class=\&quot;ctools-use-ajax panels-modal-add-config\&quot; title=\&quot;add node site content.\&quot;\x3eexisting node\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\&quot;content-type-button clear-block\&quot;\x3e\x3ca href=\&quot;/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/custom/custom\&quot; class=\&quot;ctools-use-ajax panels-modal-add-config\&quot; title=\&quot;create custom piece of html content.\&quot;\x3e\x3cimg src=\&quot;/home/sites/all/modules/ctools/images/no-icon.png\&quot; alt=\&quot;\&quot; title=\&quot;\&quot; width=\&quot;16\&quot; height=\&quot;16\&quot; /\x3e\x3c/a\x3e\x3cdiv\x3e\x3ca href=\&quot;/home/panels/ajax/editor/add-pane/panel_context%3apage-faculty_page%3apage_faculty_page_panel_context/center/custom/custom\&quot; class=\&quot;ctools-use-ajax panels-modal-add-config\&quot; title=\&quot;create custom piece of html content.\&quot;\x3enew custom content\x3c/a\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\&quot;panels-categories-description\&quot;\x3econtent options divided category. please select category left proceed.\x3c/div\x3e\x3c/div\x3e&quot; } ] 

remove quotes around regex

  error_text = error_text.replace(/&(lt|gt|quot);/g, function (m, p) {      return (p == "lt")? "<" : (p == "gt") ? ">" : "'";   }); 

demo http://jsfiddle.net/gaby/mfmkc/


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -