Giter VIP home page Giter VIP logo

Comments (5)

fruehaufm avatar fruehaufm commented on June 3, 2024

The same problem occurs when you use a hyperlink (e.g. with "Utility: super effective") like:
https://democert.org/ssvc/#SSVCv2/E:A/X:C/A:Y/V:C/U:S/S:A/M:F/H:H/P:O/2022-05-29T11:11:49Z/&Deployer

While "Utility: efficient" works:
https://democert.org/ssvc/#SSVCv2/E:A/X:C/A:Y/V:C/U:E/S:A/M:F/H:H/P:O/2022-05-29T11:11:49Z/&Deployer

from ssvc.

fruehaufm avatar fruehaufm commented on June 3, 2024

I've developed a potential solution for this issue by replacing the spaces in the JSON Tree files (I tried it with Deployer-v2.0.0.json) with underscores and replacing spaces in the clickprocess() function as well. This seems to work quite well..
For the GUI representation I undid the replacement in parse_json(), update_links() and dynamic_mwb().
This way only the nameid looks like "nameid="very_high" for example.
I can let you know when I'm done.

from ssvc.

sei-vsarvepalli avatar sei-vsarvepalli commented on June 3, 2024

Hi @fruehaufm

Appreciate make a PR if you are able to. If not I will get to have this fixed. I think allowing names to contain spaces and UTF-8 support is not something I did. It may be required or a simple umlaut may break it too..

Thanks
Vijay

from ssvc.

sei-vsarvepalli avatar sei-vsarvepalli commented on June 3, 2024

Hi @fruehaufm

I think I fixed it using the function safedivname which ensures any invalid character can still be allowed. As this function already exists, it seems to be best to replace all the raw use of names with this function. The demo site https://democert.org/ssvc/ has the private dev branch which is already installed, so hopefully the bugs are fixed there.

SSVC/ssvc-calc/ssvc.js

Lines 810 to 818 in 2f5905c

function safedivname(instr) {
var uri_esc = encodeURIComponent(instr)
var safestr = btoa(uri_esc.replace(/%([0-9A-F]{2})/g,
(m, p) =>
String.fromCharCode('0x' + p)));
var fstr = "d-"+safestr.replace(/[\+\/\=]/gi,
(m,p) => { return m.charCodeAt(0) });
return fstr.substr(0,14);
}

from ssvc.

fruehaufm avatar fruehaufm commented on June 3, 2024

Great, sounds like a good solution!

from ssvc.

Related Issues (20)

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.