This might me a newbie question but can someone please tell me know to make React show input text as code?
I am writing a document and I want to add a JSON format in it. However, instead of this:
{
"policies":{
"ExtensionSettings":{
"*":{
"blocked_install_message":"Custom error message.",
"install_sources":[
"about:addons",
"https://addons.mozilla.org/"
],
"installation_mode":"allowed",
"allowed_types":[
"extension"
]
},
"{d634138d-c276-4fc8-924b-40a0ea21d284}":{
"installation_mode":"force_installed",
"install_url":"https://addons.cdn.mozilla.net/user-media/addons/950528/1password_password_manager-1.23.1-fx.xpi?filehash=sha256%3A47e9e98f1072d93d595002dc8c221e5cca17e091b3431563a8e3e2be575c5cc1"
}
}
}
The outcome is this:
{ "policies": { "ExtensionSettings": { "*": { "blocked_install_message": "Custom error message.", "install_sources": ["about:addons","https://addons.mozilla.org/"], "installation_mode": "allowed", "allowed_types": ["extension"] }, "{d634138d-c276-4fc8-924b-40a0ea21d284}": { "installation_mode": "force_installed", "install_url": "https://addons.cdn.mozilla.net/user-media/addons/950528/1password_password_manager-1.23.1-fx.xpi?filehash=sha256%3A47e9e98f1072d93d595002dc8c221e5cca17e091b3431563a8e3e2be575c5cc1" } } }
I am using React Semantic UI and wrap the text in <Container> component.