All Questions
28 questions
3
votes
1
answer
163
views
Bulk Text Replacer
I have created a simple text editor with a "replace all" feature. It's meant to be part of a larger project, so it needs to be robust and work reliably across various scenarios. Please ...
2
votes
1
answer
203
views
Sanitize user-supplied HTML with Python and Regular Expressions
I have a product that needs to have users put content in a form that potentially contains HTML and display it back to other users. I'd like to mitigate the risk as much as possible, and I can limit ...
2
votes
1
answer
113
views
Validator and Sanitizer for HTML 5 attribute regex according to current HTML living standard
According to https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 an HTML 5 attribute name is defined like this:
Attribute names must consist of one or more characters other than
controls, ...
3
votes
1
answer
288
views
rename .html file from <title> tag with python
I have many html files saved to my computer.they have same tags like this: Rpi-Cam-Web-Interface- Page 2 - forum
and the page number changes
I want to rename file ...
9
votes
2
answers
363
views
Follow-up: Javascript Syntax-Highlighter for Java
Background
The basics of this project have already been discussed here.
I've improved the following things:
Sᴀᴍ Onᴇᴌᴀ mentioned that I shouldn't use multiple elements with the same id. I corrected ...
15
votes
5
answers
2k
views
Javascript Syntax-Highlighter for Java
Project
I wanted to create a syntax highlighter for Java using JavaScript, HTML and CSS. It uses regular expressions to find the parts that should be highlighted (at the moment: keywords, strings, ...
5
votes
1
answer
931
views
Converting Markdown to HTML using Go
I recently ported a blog of mine from Python to Go (to improve speed and performance) and while all is great so far, I'd like some help optimising the Markdown ...
0
votes
2
answers
6k
views
Remove all html special chars
Before saving the input from users in the database, I am using the below function to replace all HTML special chars. All my users will always be using the English Language.
Option 1
...
3
votes
2
answers
5k
views
Send html with nonce for each script and style tag on each request
This working code inserts a nonce attribute and value for each style and script tag inside an HTML file, for each GET request. It is using Express. nonce1 and ...
1
vote
4
answers
20k
views
Function to remove specified html tags from string
I recently wrote this function that, when supplied a string and an array of element types, will remove those element types from the string.
As you could imagine this is a very very simple function, ...
3
votes
1
answer
1k
views
Using simple HTML template to create HTML formatting rules
One of my tools that renders HTML needs some rules about document formatting. The renderer can format the output so that it is indented and contains appropriate line-breaks. In the first version I ...
5
votes
1
answer
137
views
Method to encode ordinary characters into html format
I have had a problem with encoding in a project when trying to convert certain html code into image format. It happens when we receive html that has certain characters with accents and other non ...
6
votes
0
answers
2k
views
Decode HTML Entities in VBA using regex and dictionary
I receive HTML-encoded text that includes named and numbered entities, and I need the decoded HTML.
There were just too many bad solutions for this online.
I use regex pattern ...
4
votes
2
answers
177
views
Regex Tool in PHP
I'm looking for feedback about anything and everything to do with this short program. For example, is there a risk in not sanitising the data, and if so, how would I do that given the need for non-...
1
vote
1
answer
76
views
Formatting a CHANGES text file as HTML
I have a function which is used to convert text (a CHANGES file) into HTML for reading. The function is essentially line-based: if the line is of this type, do this thing; if some other type, do that ...