Skip to content

Commit

Permalink
Merge pull request #49 from glycojones/id_issue_fix
Browse files Browse the repository at this point in the history
Added regex sanitisationm, closes #48
  • Loading branch information
Dialpuri authored Oct 4, 2023
2 parents 85d4b5d + 9d831ee commit 3e5209a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webserver/src/pages/Home/HomeSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export default function HomeSection() {
const [resetApp, setResetApp] = useState(false)
const [fallback, setFallBack] = useState(false)

let sanitize_id = (id) => {
const regex = /: *32/g;
const new_id = id.replace(regex, "")
return new_id
}

useEffect(() => {
privateer_module().then((Module) => {
var reader = new FileReader();
Expand All @@ -35,6 +41,8 @@ export default function HomeSection() {
for (var i = 0; i < x.size(); i++) {
let table_entry = x.get(i)

table_entry.id = sanitize_id(table_entry.id)

let collected_torsions = []
for(var j = 0; j < table_entry.torsions.size(); j++) {
collected_torsions.push(table_entry.torsions.get(j));
Expand Down

0 comments on commit 3e5209a

Please sign in to comment.