Remove html tags / replace <br> etc with its html style (Create a break) from api response

Yes. And all the rest of the dirt where at first it is \

so the only “slashes” as such in the text should be forward slash?

Do you know what escape sequences are?

I do not, no

The \ character is used to escape characters. The symbol \ itself is escaped as \\. You need to decode the text back. To do this, you need to correctly remove all \

https://mathiasbynens.be/notes/javascript-escapes

1 Like

hmm, okay. So do i just remove every possible escape codes?

Yes, plus you need to remove all the special characters that interfere with the display, which are encoded as &something;

ah yes, and would there be a handy list or something online that shows all the possible special characters? is there one on w3schools? thanks

Check out the HTML directories or docs. I also recommend that you study HTML - useful.

Okay. So as long as remove the &something; codes, and the \ then I should be okay?

If the resulting text is displayed without problems in WebViewer. You can send your clean code to yourself by email and check in the browser on the PC

and am i just removing the backwards slash \
? as well as all the &something;

Yes. You said you know a little C ++ and PHP. In this case, you can try using them to do the cleaning, and then implement the algorithm in the form of blocks, if so it will be easier for you.

I never said that :stuck_out_tongue: I am not good at coding, if you haven’t noticed :slight_smile:

I’ll google how html cleaning works, and try build off of that i guess.

Yes, sorry, this was a completely different user :wink:

Today I am busy, but I think that other users could help to pass the code cleaning algorithm. This may be useful to someone else. If no one does, then tomorrow I will see it.

Yeah no worries, if you are busy i completely understand. I really appreciated your help! Thank you.

I would like to report I have gotten this working. After making a replace &something; with nothing and &#numbers; here for pretty much every possible bloody outcome, I have got it to work!

The only issue is the scaling. The photos are far to big in web viewer. Is there any way of changing this?

Thanks

If i make the text size as shown here to 0.5 it shows like this, but in 1, the text changes to the screen but the photos do not.

data:text/html,<meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=0.5"/>

Instead of scale=1.0
This is great though in a way, I can now add a font size button, so people can increase the font with a slider :slight_smile:

But the photos do not change for me, unless there is a way that I can find text called pixel width or something, get the data between < and > and set it to auto or something.

But honestly I am delighted I got this much working.

Actually, there is one slight issue with this post. I believe it is the fact that is has Font crap at the start.

<p><span style=\"color: #000000;\"><span style=\"font-family: Times New Roman, serif;\"><span style=\"font-size: large;\">SAOLTA Healthcare Group has issued a statement in relation to the planned strike of support staff at Letterkenny University Hospital tomorrow. The said they are continuing to put contingency plans in place in advance of the industrial action which affects up to 425 SIPTU members at LUH.</span></span></span></p>\n<p><span style=\"color: #000000;\"><span style=\"font-family: Times New Roman, serif;\"><span style=\"font-size: large;\">A Spokesperson said: “Across each of the hospitals, patients whose procedures or appointments are being cancelled are being contacted directly – this mostly relates to inpatient elective procedures, scopes and day case procedures. Some Outpatient Clinics have also been cancelled – it varies from hospital to hospital but patients are being notified directly, if patients do not hear from their hospital they should attend their appointment as scheduled.</span></span></span></p>\n<p><span style=\"color: #000000;\">“<span style=\"font-family: Times New Roman, serif;\"><span style=\"font-size: large;\">Emergency Departments will remain operational across the Group although patients can expect significant delays. At Roscommon University Hospital, the Injury Unit will remain open.</span></span></span></p>\n<p><span style=\"color: #000000;\">“<span style=\"font-family: Times New Roman, serif;\"><span style=\"font-size: large;\">Critical care areas such as ICU and HDU will function as normal. Chemotherapy treatment and dialysis will proceed as scheduled across the Group. There will be reduced or very limited catering services for both patients and staff in some hospitals in the Group.</span></span></span></p>\n<p><span style=\"color: #000000;\">“<span style=\"font-family: Times New Roman, serif;\"><span style=\"font-size: large;\">We regret the inconvenience for patients and will work to reschedule their appointments as quickly as possible.”</span></span></span></p>\n<p><span style=\"font-family: Times New Roman, serif;\"><span style=\"font-size: large;\"><span style=\"color: #000000;\">SIPTU representatives </span><span style=\"color: #000000;\">c</span><span style=\"color: #000000;\">onfirmed </span><span style=\"color: #000000;\">yesterday</span><span style=\"color: #000000;\"> that talks at the Workplace Relations Commission (WRC) aimed at resolving a dispute on job evaluation have concluded without an agreement. </span></span></span></p>\n<p><span style=\"font-family: Times New Roman, serif;\"><span style=\"font-size: large;\">SIPTU Health Divisional Organiser, Paul Bell said: “SIPTU would prefer a negotiated settlement that does not impact on patient services. Unfortunately, we have run out of time and too many issues remain unresolved. SIPTU members have acted in good faith at all times during this dispute including by deferring two days of strike action. We believe that the Government has abused the conciliation process and never meaningfully engaged with SIPTU representatives. Some €16.2 million is owed to our members yet the Department of Public Expenditure and Reform has only offered €1.2 million to resolve this dispute. Furthermore, the Department has attempted to frustrate this process by seeking to unilaterally change a crucial element of the job evaluation scheme which centres on the assimilation of pay to new grades as awarded under this independent process.”</p>\n<p>He added: “A 24 hour strike, involving up to 10,000 support staff, will go ahead from 8.00 a.m on Wednesday (26th June) as our members continue to pursue their legitimate claim for recognition, respect and pay justice.”</span></span></p>\n

That is the code that is causing a problem.