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

  • Home
  • SEARCH
  • 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 8788493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:09:29+00:00 2026-06-13T22:09:29+00:00

I am using wysihtml5 wysiwyg editor. The problem is that image src attribute and

  • 0

I am using wysihtml5 wysiwyg editor.

The problem is that image src attribute and link href attribute are stripped from html. At server I am already getting stripped html.

How I can fix this problem?

I am using advanced.js rulest. With all rules.

Editor

UPDATE 1

Well editor.getValue and jquery().val() for textarea give same values on form submit. means that form should be sent correctly.

But I’v watched POST request which is sent from the browser. and it is without URLs. Something wrong.

UPDATE 2

If I remove from ruleset everything connected with img, nevertheless it works inproperly.

UPDATE 3

In response to Marrowmaw comment.

I am expecting:

<a href="http://domain.com/" title="Link: http://domain.com">Link</a>

But I get

<a href="" title="Link: Null">Link</a>

UPDATE 4

<div id="wysihtml5-toolbar" style="display: none;">
      <button class="btn" data-wysihtml5-command="bold">
        {{ "Bold"|trans }}
      </button>
      <button class="btn" data-wysihtml5-command="italic">
        {{ "Italic"|trans }}
      </button>
      <button class="btn" data-wysihtml5-command="createLink">
        {{ "Link"|trans }}/{{ "Unlink"|trans }}
      </button>
      <button class="btn" data-wysihtml5-command="insertUnorderedList">
        *
      </button>
      <button class="btn" data-wysihtml5-command="insertOrderedList">
        1,2,3
      </button>
      <button class="btn" data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1">
        {{ "Heading"|trans }}
      </button>
      <button class="btn" data-wysihtml5-command="insertImage">
        {{ "Image"|trans }}
      </button>

        <div data-wysihtml5-dialog="createLink" style="display: none;">
          <label>
            {{ "Link"|trans }}:
            <input data-wysihtml5-dialog-field="href" value="http://">
          </label>
          <a data-wysihtml5-dialog-action="save">{{ "Save"|trans }}</a>&nbsp;<a data-wysihtml5-dialog-action="cancel">{{ "Cancel"|trans }}</a>
        </div> 
             <!-- Dialog -->
         <div data-wysihtml5-dialog="insertImage" style="display: none;">
           <label>
             URL: <input data-wysihtml5-dialog-field="src" value="http://">
           </label>
           <label>
             Alternative text: <input data-wysihtml5-dialog-field="alt" value="">
           </label>
           <label>
                {{ "Align"|trans }}:
                <select data-wysihtml5-dialog-field="className">
                  <option value="">{{ "default"|trans }}</option>
                  <option value="wysiwyg-float-left">{{ "left"|trans }}</option>
                  <option value="wysiwyg-float-right">{{ "right"|trans }}</option>
                </select>
            </label>
           <a data-wysihtml5-dialog-action="save">{{ "Save"|trans }}</a>&nbsp;<a data-wysihtml5-dialog-action="cancel">{{ "Cancel"|trans }}</a>
         </div> 
      </div>
      <form action="{{ path('###_save_homepage') }}" method="POST" >
        <textarea id="wysihtml5-textarea" placeholder="{{ "Enter your text"|trans }}..." autofocus name="homepage"  style="width:700px;height:400px;">          
            {{ homepage|raw }}          
        </textarea> 
        <input type="submit" value="{{ "Save"|trans }}" class="btn" />  
    </form>

And JS init:

<script type="text/javascript">
jQuery(document).ready(function(){
    var editor = new wysihtml5.Editor("wysihtml5-textarea", { // id of textarea element
          toolbar:      "wysihtml5-toolbar", // id of toolbar element
          parserRules:  wysihtml5ParserRules // defined in parser rules set 
        });     

    });

</script>
  • 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-06-13T22:09:31+00:00Added an answer on June 13, 2026 at 10:09 pm

    Try taking a look at the wysihtml5-x.x.x.js file you are referencing.

    They decided that they would only allow absolute URLs (in the name of guarding against XSS). The code below essentially allows you to take any value if you are comfortable with that trade off.

    Ctrl-F for “var attributeCheckMethods” and make the following changes — source:

    var attributeCheckMethods = {
    url: (function() {
        /*var REG_EXP = /^https?:\/\//i;*/
        return function(attributeValue) {
        /*if (!attributeValue || !attributeValue.match(REG_EXP)) {
            return null;*/
        if (!attributeValue) {
            return "";
        }
        /*return attributeValue.replace(REG_EXP, function(match) {
            return match.toLowerCase();
        });*/
    
        var parser = document.createElement('a');
        parser.href = attributeValue;
    
        if (   parser.protocol == 'http:'
            || parser.protocol == 'https:'
            || parser.protocol == 'ftp:'
        ) return attributeValue;
        };
    })(),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using mercurial, I've run into an odd problem where a line from one committer
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
I'm using wysihtml5 in the form of my Post model: posts/_form.html.erb: <%= f.text_area :content,
Using Yii, I want to delete all the rows that are not from today.
Using a CSS image sprite, I'm creating an 'interactive' image where hovering over certain
Using SQL Server 2008 R2 we are looking for a way to select the
Using Microsoft SQL Server 2005, is there any way to see when a table
Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database
(Using MVC 2) From inside my controller action, I need to display the url:
I'm using bootstrap-wysihtml5-rails in my rails app, all is working well until I attempt

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.