Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6234317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:27:49+00:00 2026-05-24T10:27:49+00:00

The wysiwyg editor I’m using uses this to replace the <strong> with a span

  • 0

The wysiwyg editor I’m using uses this to replace the <strong> with a span style. I modified to add a code block.

v=v.replace(/<strong>(.*)<\/strong>/gi,'<span style="font-weight: bold;">$1</span>');

This works fine until I highlight code with

v=v.replace(/<pre>(.*)<\/pre>/gi,'<div id="precode"> $1 </div>');

I have been looking and can’t fine any info on replace. Can someone explain

Can someone explain this part of the code? I’m sure it will help others as well

.replace(/<strong>(.*)<\/strong>/gi,'

Is there something in this causing the it to add the new style to each
line

if(id=='style'){
                var sel=document.createElement('select'),
                styles=obj.styles||[['Style',''],['Paragraph','<p>'],['Header 1','<h1>'],['Header 2','<h2>'],['Header 3','<h3>'],['Header 4','<h4>'],['Header 5','<h5>'],['Header 6','<h6>'],['CodeBlock','<pre>']],
                sl=styles.length, x=0;
                sel.className='testyle'; sel.onchange=new Function(this.n+'.ddaction(this,"formatblock")');
                for(x;x<sl;x++){
                    var style=styles[x];
                    sel.options[x]=new Option(style[0],style[1])
                }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:27:50+00:00Added an answer on May 24, 2026 at 10:27 am

    When you pass the string to find in /…/gi it looks for all the occurences of that string in the origincal string and replaces it by the string we pass as second parameter. It does not modify the original string so you have to assign its output to some variable in order to use it. I hope this makes sense.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use InnovaStudio WYSIWYG Editor , and I am trying to replace InnovaStudio's Asset
I am using a wysiwyg editor in a web app. It is FCKeditor. In
I'm building a wysiwyg-editor with an editable iframe using document.execCommand() . Now i need
im using TinyMCE Wysiwyg editor, and when i enter a link, or an image
I am using the Jquery Wysiwyg editor and I am trying to capture the
I have a working rails 3.1 application that uses the mercury wysiwyg editor, however
I'm currently using Firefox 7.0.1. I've been working on a WYSIWYG editor and just
I'm writing a blog editor using pyqt4. My issue is this. There is a
I have created a wysiwyg editor as a standard C# program using the windows
When using a WYSIWYG editor in Joomla 1.5 to create website content I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.