JavaScript Replace not self-closed br or img tags in nodejs

The problem is the same as in Close all HTML unclosed IMG tags, but the provided regexp (<img[^>]+)(?<!/)> requires lookbehind support - which nodejs does not have.

How can I achieve the same result in nodejs?

The source HTML is generated by another application.

Answer:1

I have a 'beginner' question. Why does this error out? I call the function in the code, but the function is defined further down. AngularJS version: var myApp = angular.module('myApp',[]); function ...

I have a 'beginner' question. Why does this error out? I call the function in the code, but the function is defined further down. AngularJS version: var myApp = angular.module('myApp',[]); function ...

Trying to get the tree layout in D3 to render the child nodes with children closer together. Here is the code: var margin = { top: 20, right: 120, bottom: 20, ...

Trying to get the tree layout in D3 to render the child nodes with children closer together. Here is the code: var margin = { top: 20, right: 120, bottom: 20, ...

I have nav tabs within a modal as shown. I am using the meteor framework. Here is the modal link from sign up button (there is another button called login that links to same modal): <button class=...

I have nav tabs within a modal as shown. I am using the meteor framework. Here is the modal link from sign up button (there is another button called login that links to same modal): <button class=...

I have the following javascript: $('#edit_category').on('click','#btn_save_category_name',function(){ currently_edit.text($('#txt_edit_category').val()); edit_category_name(currently_edit,...

I have the following javascript: $('#edit_category').on('click','#btn_save_category_name',function(){ currently_edit.text($('#txt_edit_category').val()); edit_category_name(currently_edit,...

  1. jquery ajax called twice
  2. jquery ajax called multiple times
  3. jquery ajax error called on 200
  4. jquery ajax fail called on 200
  5. jquery ajax get called twice
  6. jquery ajax success called multiple times
  7. jquery ajax success called too early
  8. jquery ajax not called
  9. jquery ajax done called twice
  10. jquery ajax success called twice
  11. jquery datatable ajax called twice
  12. jquery ajax success not called
  13. jquery ajax done not called
  14. jquery ajax always not called
  15. jquery ajax success not called 200
  16. jquery ajax error not called
  17. jquery ajax fail not called
  18. jquery ajax complete not called
  19. jquery ajax callback not called
  20. jquery ajax fail always called