Giter Club home page Giter Club logo

deform's Introduction

Deform

Build Status Current Release Main Documentation Status Latest Documentation Status

Python Support

Deform is a Python form library for generating HTML forms on the server side. Date and time picking widgets, rich text editors, forms with dynamically added and removed items and a few other complex use cases are supported out of the box.

Deform integrates with the Pyramid web framework and several other web frameworks. Deform comes with Chameleon templates and Bootstrap 5 styling. Under the hood, Colander schemas are used for serialization and validation. The Peppercorn library maps HTTP form submissions to nested structure.

Although Deform uses Chameleon templates internally, you can embed rendered Deform forms into any template language.

Deform is ideal for complex server-side generated forms. Potential use cases include:

  • Complex data entry forms
  • Administrative interfaces
  • Python based websites with high amount of data manipulation forms
  • Websites where additional front end framework is not needed

Install using pip and Python package installation best practices:

pip install deform

See all widget examples. Below is a sample form loop using the Pyramid web framework.

https://github.com/Pylons/deform/raw/main/docs/example.png

Example code:

"""Self-contained Deform demo example."""
from __future__ import print_function

from pyramid.config import Configurator
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.httpexceptions import HTTPFound

import colander
import deform


class ExampleSchema(deform.schema.CSRFSchema):

    name = colander.SchemaNode(
        colander.String(),
        title="Name")

    age = colander.SchemaNode(
        colander.Int(),
        default=18,
        title="Age",
        description="Your age in years")


def mini_example(request):
    """Sample Deform form with validation."""

    schema = ExampleSchema().bind(request=request)

    # Create a styled button with some extra Bootstrap 3 CSS classes
    process_btn = deform.form.Button(name='process', title="Process")
    form = deform.form.Form(schema, buttons=(process_btn,))

    # User submitted this form
    if request.method == "POST":
        if 'process' in request.POST:

            try:
                appstruct = form.validate(request.POST.items())

                # Save form data from appstruct
                print("Your name:", appstruct["name"])
                print("Your age:", appstruct["age"])

                # Thank user and take him/her to the next page
                request.session.flash('Thank you for the submission.')

                # Redirect to the page shows after succesful form submission
                return HTTPFound("/")

            except deform.exception.ValidationFailure as e:
                # Render a form version where errors are visible next to the fields,
                # and the submitted values are posted back
                rendered_form = e.render()
    else:
        # Render a form with initial default values
        rendered_form = form.render()

    return {
        # This is just rendered HTML in a string
        # and can be embedded in any template language
        "rendered_form": rendered_form,
    }


def main(global_config, **settings):
    """pserve entry point"""
    session_factory = UnencryptedCookieSessionFactoryConfig('seekrit!')
    config = Configurator(settings=settings, session_factory=session_factory)
    config.include('pyramid_chameleon')
    deform.renderer.configure_zpt_renderer()
    config.add_static_view('static_deform', 'deform:static')
    config.add_route('mini_example', path='/')
    config.add_view(mini_example, route_name="mini_example", renderer="templates/mini.pt")
    return config.make_wsgi_app()

This example is in deformdemo repository. Run the example with pserve:

pserve mini.ini --reload

This library is actively developed and maintained. Deform 2.x branch has been used in production on several sites since 2014. Automatic test suite has 100% Python code coverage and 500+ tests.

deform's People

Contributors

aodag avatar calvinhp avatar cguardia avatar cjw296 avatar dairiki avatar davidjb avatar delijati avatar digitalresistor avatar dnouri avatar do3cc avatar domenkozar avatar ericof avatar frispete avatar gjo avatar j20s avatar jandd avatar kiorky avatar krysros avatar lelit avatar lmctv avatar mcdonc avatar miohtama avatar mnaberez avatar rbu avatar stevepiercy avatar sydoluciani avatar themanwithoutaplan avatar tisdall avatar tseaver avatar wichert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deform's Issues

static/scripts/jquery.autocomplete.min.js should go

I just wasted an hour before I found out that you're not supposed to use jquery.autocomplete.min.js with the AutocompleteInputWidget, but jquery-ui-1.8.4.custom.min.js

If jquery.autocomplete in its bare form is no longer used, which I don't think it is, then it should go.

Inability to add arbitrary html snippet as button

You can only have real form buttons. Either by specifying the tile, or by giving a deform.Button object.

What I need sometimes is to have some arbitrary html in the form where it has the buttons (for design reasons mostly).

Right now my workaround is to move that html next to the buttons with some jquery after the page has loaded - but what I really want is to have the controll to just render arbitrary html as one of the buttons.

Abstraction from template language

deform depends on colander, deform and colander depends on translationstring. All of this libraries have depenpency on chameleon in source code:

colander/init.py

min_err = _('${val} is less than minimum value ${min}')
max_err = _('${val} is greater than maximum value ${max}')

deform/schema.py

raise colander.Invalid(
node,
_('${value} is not iterable', mapping={'value':value})
)

translationstring/init.py

if translated and '$' in translated and mapping:
return TranslationString(translated, mapping=mapping).interpolate()

So why do you say that "alternate templating languages may be used, as long as all templates are translated from the native Chameleon templates to your templating system of choice and a suitable renderer is supplied to deform"?
It will render the templates, but error messages would be wrong.

I really appreciate this library and want to use it, but I use jinja2 and I can't adapt deform to it because error messages are wrong. Would it be possible to abstract from template language?

nosexcover and coverage versions

When running tox, the environment with coverage fails because the latest version of coverage is not compatible with the latest nosexcover.

I previously pinned the versions because I had the same problem but the pinning was removed. I assume there must be some reason. Is there any other way to control the versions used in tox without pinning them explicitely in the tox.ini?

Make SelectWidget's null_value depend on the multiple argument

The multi select widget's default null_value of "" should really be () when multiple==True. If it is not, the select option with value=="" will be selected when serializing from an appstruct that does not have any value.

Workaround: remember to always set multiple=True, null_value=() together when defining a widget

Expectation from the framework: the null_value default should be context sensitive when not explicitly specified by a subclass.

This is copied from #104, #104 (comment)

No escaping with Chameleon >= 2.3

Hello.

When I install deform in a new environment, it automaticly installs Chameleon 2.4 (>=1.2.3). But with version 2.3 and above, deform will not longer escape any input or values. Neither in my pyramid app nor in deformdemo.

Issue with field using readonly template on validation error

Hi, i've found that there is a small issue related with validation when some field it's using it's readonly template; the thing is, when you put a readonly template on a field, if the first (and/or subsequest) attempt to send the form for processing doesn't validate, when the form gets re-rendered this readonly field always appears empty.
Thanks,

simpler HTML structure for readonly templates

To ease the ability to style read-only data, I'd like to have a more consistent approach to the html structure generated. right now it's a mix of DIV + LI, SPAN + P. I would expect a well formed html scturcutree to make sense without any CSS, which usually means that it can be styled whichever way without issues. Also the HTML generated should mix well with the input version of the form, so we can mix and match readonly and readwrite fileds in the future.

Here's what I propose:

  • MappingSchema = Unordereded List <UL>
  • MappingSchemaItem = List Item <LI>
  • Field title = span with the "desc" class <SPAN>
  • Field value = span with the "value" class <SPAN>
  • SequenceSchema = Ordereded List <OL>

That's it. this way any schema would end up looking the way one would expect a dictionary of key,value pairs to be represented in HTML, as a series of lists. I prefer span over p or div tags by default because they have no built-in styling, and it's always easier to make a span behave like a block than the other way around.

I would also suggest to encode the type of the value in a class of the value span. this would allow styling based on value (like the "Password Not Displayed" tag which shouldn't have a EM tag, but use CSS to style password fields a certain way.

Sequence of simple types does not deserialize unless it has a name

Consider the following schema similar to this demo http://deformdemo.repoze.org/sequence_of_constrained_len/

class EmailMessage(colander.Schema):
    subject = colander.SchemaNode(colander.String())
    to = colander.SchemaNode(colander.Sequence(), colander.SchemaNode(colander.String()))

This will correctly serialize and deserialize in colander for an app/cstruct such as

dict(subject='hello', to=['@'])

However, rendering the deform for it will not create a structure that can be read back by deform, because the inner SchemaNode of the sequence has no name. deform will render the following:

deform.Form(schema=EmailMessage()).render(dict(subject='hello', to=['@']))

<input type="hidden" name="__start__" value="to:sequence"...>
<input type="text" name="" value="@" />

A working way to declare the schema is:

class EmailMessage(colander.Schema):
    subject = colander.SchemaNode(colander.String())
    to = colander.SchemaNode(colander.Sequence(), colander.SchemaNode(colander.String(), name="ignored"))

I would argue that deform should either insert a random name if none is given (or needed) or raise an assertion during render if a name is always required. This was a completely unobvious behavior and debugging it took quite a while.

deform.load() call should be part of the deform.js library

Any reason that the deform.load() call is not made directly inside the deform.js library? adding a callback on document.ready with JQuery would work just as well, and make it easier on the template creation.

$(document).ready( deform.load );

Please show description in widgets

Whenever the description-keyword is used in a schema, deform adds its contents to a title-attribute in the label field. While this works if you hover over the widget, most users won't expect that behaviour.

When we've tried deform on usergroups that have moderate to little computer experience, not a single one of them realised what to do with fields that actually required that you red the description. (Like something with a regexp validator)

It would be great if the description was normal text below the title, preferably in a non-bold font.

I can update the widgets if you guys think this is a good idea.

Cheers,
Robin

Minor Documentation Typos

in deformdemo/app.py, two references to Formish rather than Deform

Formish allows you to pair a widget against a type that

against a sequence type. To provide this feature, Formish

Template for checkbox widget raise a error

This bug does not existed in 0.5 release.

When we declare a SchemaNode which type is colander.Boolean, and render it with readonly=True, a exception would raise and said checkbox.pt contains errors.

Title rendered twice in form

If the top-level schema for a form has a title set, then said title is rendered in two places: once in the fieldset legend, and again in an <h3>.

My guess is that the title in the <h3> tag should be eliminated. I'll post a patch here momentarily.

'Add item' feature of sequence widget should be optional

currently, if you have no use for the 'add item' feature of the sequence widget you have to customize the sequence.pt template and remove markup.

i suggest making this configurable. what do you think? i can implement this on my fork, but want to check first with you, if you'd be willing to include such a feature.

weird deform parsing

As discussed on #pyramid, deform appears to have a problem with nested schemata. The test case, which I'll try to attach to this ticket (or else, push into my own account), produces this in the pdb session:

serving on http://0.0.0.0:6545
> /mounts/5/zope/pyramid/deform-problem/problem/problem/views.py(29)my_view()
-> appstruct = myform.validate(controls)
(Pdb) controls
[(u'_charset_', u'UTF-8'), (u'__formid__', u'myformid.'), (u'csrf', u'1276c06e8d66a41455bf0d936dbc07c811077004'), (u'__start__', u':mapping'), (u'sub1_1', u'asdasd'), (u'__end__', u':mapping'), (u'__start__', u':mapping'), (u'sub2_1', u''), (u'sub2_2', u''), (u'__end__', u':mapping'), (u'submit', u'submit')]
(Pdb) s
--Call--
> /mounts/5/zope/.virtualenvs/deform-problem/lib/python2.6/site-packages/deform-0.9.4-py2.6.egg/deform/field.py(439)validate()
-> def validate(self, controls):
(Pdb) n
> /mounts/5/zope/.virtualenvs/deform-problem/lib/python2.6/site-packages/deform-0.9.4-py2.6.egg/deform/field.py(506)validate()
-> pstruct = peppercorn.parse(controls)
(Pdb) 
> /mounts/5/zope/.virtualenvs/deform-problem/lib/python2.6/site-packages/deform-0.9.4-py2.6.egg/deform/field.py(507)validate()
-> exc = None
(Pdb) pstruct
{u'': {u'sub2_2': u'', u'sub2_1': u''}, u'__formid__': u'myformid.', u'submit': u'submit', u'_charset_': u'UTF-8', u'csrf': u'1276c06e8d66a41455bf0d936dbc07c811077004'}

CheckboxChoiceWidget substring issue

x = colander.SchemaNode(colander.String(),
widget=widget.CheckboxChoiceWidget(values=(('men', 'Men'), ('women', 'Women'))))

Rendering this form fails to differentiate between checked and unchecked boxes sometimes. If I select only men, the form will render just men. If I select women, it renders both. I'm guessing it's some sort of substring issue, because if you switch 'women' to something that doesn't have men in it, the form works as it should.

Error messages from HiddenWidgets / Handling of compound error messages

I've noticed that error messages triggered by hidden fields (e.g. fields using a HiddenWidget) do not get displayed. I think the solution to this is for MappingWidget to get a custom handle_error method which will stick the messages from any hidden subfields into the mapping's error messages.

While looking into this, I noticed a second issue. Some parts of deform properly handle array-valued Invalid.msgs (see, e.g., mapping_item.pt, sequence_item.pt); other parts expect a scalar string value (e.g. mapping.pt).

I think that compound (array-valued) error messages should be allowed on any Invalid instance. To that end:

  • mapping.pt should be fixed to support compound error messages
  • Field.errormsg needs attention. My suggestion is that, in the case of compound error messages, it should return '\n'.join(msg). It should also probably be deprecated.
  • TextAreaCSVWidget.handle_error and TextInputCSVWidget.handle_error should put compound error messages in a array rather than concatenating them into a single string. (Also the example at the end of the handle_error part of the "Writing Your Own Widget" doc section should be updated.)

I'm willing to formulate this as a pull request, but I wanted to run it by you first to make sure that it all sounds reasonable.

DateInput and DateTimeInput widget should use the altField option

Since colander.Date and colander.DateTime expect a iso8601 format, in order to allow dateFormat override :

  • the altfield should fix the submitted altFormat
  • the displayed field should be customizable to fit end-users' needs.

Nowaday, it's not possible to override the dateFormat option (colander says it's an invalid date).

Structural widgets should use css_class of items on container

When styling a structured form (using a mapping), "page furniture" is introduced around a field widget by the mapping. It is rather inconvenient and error-prone to apply any styling to the containing li elements based on the css_class of a contained elment (e.g., an input tag).

The structural widgets should apply the inner css class to the item container they render directly.

Missing internationalization in Label and Description

Hi,

There is problem with missing invalidation of "subject" and "confirm_subject" variables in deform.widget.CheckedPasswordWidget template. CheckedInputWidget works great but not password widget. Instead of
line no. 8:<label for="${oid}" i18n:translate="">Password</label>
and
line no. 14:<label for="${oid}-confirm" i18n:translate="">Confirm Password</label>

it should be probably
line no. 8:<label for="${oid}" i18n:translate="">${subject}</label>
and
line no. 14:<label for="${oid}-confirm" i18n:translate="">${confirm_subject}</label>

Empty error message translated on sequence item

On file "sequence_item.pt" if field.error.messages() comes with a false empty (equal to [None]), the empty message on locale file is returned like "Project-Id-Version: deform 0.0 Report-Msgid-Bugs-To: (...) By: Babel 0.9.6"

I change this code:

<p tal:condition="field.error and not field.widget.hidden" tal:define="errstr 'error-%s' % field.oid" tal:repeat="msg field.error.messages()" tal:attributes="id repeat.msg.index==0 and errstr or ('%s-%s' % (errstr, repeat.msg.index))" class="${field.widget.error_class}" i18n:translate="">${msg}</p>

To this:

<tal:c condition="field.error and not field.widget.hidden" define="errstr 'error-%s' % field.oid" repeat="msg field.error.messages()"> <p tal:condition="msg" tal:attributes="id repeat.msg.index==0 and errstr or ('%s-%s' % (errstr, repeat.msg.index))" class="${field.widget.error_class}" i18n:translate="">${msg}</p> </tal:c>

But maybe is better to fix the messages method on colander.

please make sure that methods are spelt as "post" and "get"

While checking a generated web page for XHTML compatibility, I found that a method of "POST" is illegitimate. Checking the HTML5 docs also say that methods must be "post" or "get" (lower case). I then looked into the renderer, but found that many packages seem to test for "POST" and "GET", and also generate these upper case names.

It would be nice if someone could find a way to convert these to generate lower case versions of these methods. If partial solutions are ok, I can walk through packages and submit small patches as I go, but if a coordinated solution is required, then I'm a bit at a loss.

form.pt does not show validation errors from the top node of the schema

The error message generated by the test below isn't rendered.

import deform
import colander


class LoginForm(colander.Schema):
    username = colander.SchemaNode(colander.String())
    password = colander.SchemaNode(colander.String(),
            widget=deform.widget.PasswordWidget())

def validate_password(node, d):
    raise colander.Invalid(node, 'Username does not match password')

loginform = LoginForm(validator=validate_password)

try:
    d = deform.Form(loginform).validate([
        ('__formid__', 'deform'),
        ('username', 'kai'),
        ('password', '123')])
except deform.ValidationFailure, e:
    print e.render()

This snippet appears in .errorLi of mapping.pt but seems to be missing in form.pt.

<p class="errorMsg">${field.errormsg}</p>

Widget should own its renderer

When extending a widget (e.g., to use a template with a different rendering engine), we're usually stumbling upon the fact that the renderer used to render a template is an instance variable on the Field. Consider this code example:

class ColorChooserWidget(TextInputWidget):
    template = "forms/color_chooser.jinja2"

    def serialize(self, field, cstruct, **kw):
        original_renderer = field.renderer
        field.renderer = lambda template, **kwargs: render(self.template, kwargs)
        rendered = super(ColorChooserWidget, self).serialize(field, cstruct, **kw)
        field.renderer = original_renderer
        return rendered

This works, but I do not see why the renderer would have to be set on the field. It would be much more sensible if the widgets would go through a self.render() which is easy to override.

DateWidget with jquery datepicker does conflict with Opera's HTML 5 support

Opera's (at least >= 11) support for the HTML 5 date input type [1] conflicts with the behaviour of deform's DateWidget. Opera will render it's own calendar widget on top of the jquery datepicker that deform uses, making it impossible to use the latter. In addition, Opera's calendar may insert dates in the wrong format thus making it impossible to submit valid dates.

A possible solution would be to use simple text inputs for dates. This would probably require some default styling, though.

[1] http://dev.opera.com/articles/view/new-form-features-in-html5/#input-datetime

Invalid HTML markup generated when using hidden field

I am using pyramid_deform which generate a hidden field for the CSRF token. The HTML markup is not valid according to http://validator.w3.org. Here is the error:
Element input not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)

Here is the markup:

<form
  id="deform"
  action="http://admin.mydomain.local:6002/somepath"
  method="POST"
  enctype="multipart/form-data"
  accept-charset="utf-8" class="deform"
  >

  <fieldset class="deformFormFieldset">



    <input type="hidden" name="_charset_" />
    <input type="hidden" name="__formid__" value="deform"/>
    <ul>



      <li class="section first">
        Blabla
      </li>



  <!-- mapping_item -->



  <input type="hidden" name="csrf_token" value="e73b99b716c630af8cc77686806ac3b095debfda" 
       id="deformField1"/>





  <!-- /mapping_item -->




      <li class="buttons">

          <button
              id="deformsubmit"
              name="submit"
              type="submit"
              class="btnText submit "
              value="submit">
            <span>Delete</span>
          </button>

      </li>

    </ul>

  </fieldset>



</form>

Feature: Widget's css_class should default to field name

Often times, we want to apply styles to certain form elements that can easily done purely in CSS. It feels like overkill to create a new widget for every schema node just to set the css class.

It would be a lot more helpful if the css_class of deform's Widget would default to a daherized/sanitized version of field.name with "deform-" prepended.

Add a way to include a Cancel link next to the form buttons

This is more a suggestion than an issue unless I missed the way to do it:
Add a way to include a Cancel link next to the form buttons.

I don't mean a cancel button that actually submit the form which would later be treated as a redirection but just a simple and direct link.

dateInput widget doesn't work well on chrome and opera

Since chrome and opera have added a specific handling of input with type='date', the jquery datepicker doesn't work anymore.

One solution could be to use a simple input type='text', avoiding the browser's calendar to be displayed.
Another solution could be to test the existence of input of type='date' handling and to use datepicker only when needed.

deform.js should trigger change on the form element when adding / removing input fields

When binding a callback to $(".deform").change(), it does not fire when an input element is added or removed to the DOM (as part of a sequence). This may be considered a shortcoming of jQuery, but it would be helpful if deform triggered the change event on the oid_node manually and have it bubble up.

I can provide a pull request, but I wanted to get some thoughts on this first.

readonly/sequence.pt need <ul>

Hello,

readonly/sequence_item.pt adds <li> to output but the readonly/sequence.pt template doesn't create the necessary <ul> tag. sequence.pt (read/write) handles the <ul> tag correctly. The missing <ul> tag can lead to <li> items as direct children of <li> items which cause rendering errors.

Index: deform/templates/readonly/sequence.pt
===================================================================
--- deform/templates/readonly/sequence.pt       (revision 42182)
+++ deform/templates/readonly/sequence.pt       (working copy)
@@ -2,9 +2,10 @@
      tal:define="rndr field.renderer;
                  tmpl field.widget.readonly_item_template">
   <!-- sequence -->
-
+  <ul>
   <div tal:repeat="tup subfields"
        tal:content="structure rndr(tmpl, field=tup[1], cstruct=tup[0])"/>

+  </ul>
   <!-- /sequence -->
 </div>

Autocomplete widget escapes provided values

When using widget.AutocompleteWidget, the values provided are escaped.
For example when providing

 [u"John & Son"]

The resulting generated javascript is :

$('#' + oid).autocomplete({source: ["John &amp; Son"] ...

In autocomple_input.pt :

- $('#' + oid).autocomplete({source: ${values}});
+ $('#' + oid).autocomplete({source: ${structure:values}});

Fix the issue.

Several small issues with richtext readonly widget

Hi,
the widget has the wrong template name in the widget declaration,
in the template it does not use deform addCallback, also, it declares tinymce for all textareas and not only its own. the readwrite widget does the right thing.

I have a solution in my branch but I did other things too. Mainly, I added delayed loading of the richtext widget. On large forms with many RichTextWidgets the performance
degrades a lot. If you like that feature, I can create a branch of it and submit a pull request
I

AutocompleteInputWidget javascript error

Hello,

I was trying to use the AutocompleteInputWidget as this example: http://deformdemo.repoze.org/autocomplete_input/

However I got the following error in js console.
I am using the following js files : jquery-1.7.2.min.js and deform.js

Uncaught TypeError: Object [object Object] has no method 'autocomplete' new_car_video:62
(anonymous function) new_car_video:62
(anonymous function) deform.js:39
e.extend.each jquery-1.7.2.min.js:2
e.fn.e.each jquery-1.7.2.min.js:2
deform.processCallbacks deform.js:36
(anonymous function) deform.js:28
o jquery-1.7.2.min.js:2
p.fireWith jquery-1.7.2.min.js:2
e.extend.ready jquery-1.7.2.min.js:2
c.addEventListener.B

Hope I dont miss any relevant information

Thanks!

Changing the order of widgets or adding widgets can make the browser insert form data into the wrong fields

For us this lead to password data suddenly appearing the public company field.

This is a usability problem that should not happen as it can easily lead to passwords being exposed publicly (as was the case with us).

Sure I can work around it, as soon as I know about the problem, but I really expect the form library to take care of issues like this for me. I.e. I should not have to know about this.

Best regards,
Martin

Messages escaping

Messages such as the ones raise in a custom validator are automatically escaped which prevent a correct display of their translation when they contain HTML entities such as the: 'ย ' (& n b s p ;) => Non-breaking space.
This is a secure default behavior but is there a way to take the messages as they are?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.