How to do " or \r in Prism.js in Angular6 - angular6

So I'm trying to have Prism highlight the following Arduino code snippet on my site.
client.print(String(\'\'GET \'\') + url + \'\' HTTP/1.1\r\n\'\' +
\'\'Host: \'\' + host + \'\'\r\n\'\' +
\'\'Connection: close\r\n\r\n\'\');
I initially had to change all of the " to '' but now it interprets \r\n as a line break and displays it as such. Any thoughts?

Ok, actually just got it. Use \'\'\\r\'\' to express what will be interpreted as "\r".

Related

New Line '\n' is not working in Typescript with <br/> aslo?

New Line '\n' '' is not working in Typescript
my example typescript code is
this.custPartyAddress = estimation.partyName + ',' + '\n' +
estimation.partyAddress + ',' + estimation.partyLandMark + ',' + estimation.partyCity + '\n' +
estimation.stateName + ', Pin :' + estimation.partyPostalCode + ',' + '\n' + 'India.';
Showing out put is
Raju, Sr Nagar,Near Teample,HYDERABAD Andhra Pradesh, Pin :500032, India.
if above using in place of its showing like Bellow
Raju<br/>, Sr Nagar<br/>,Near Teample<br/>,HYDERABAD Andhra Pradesh<br/>, Pin :500032, India.
html databinding
{{custPartyAddress}}
i tried many ways didt get solution could u please suggest me solution ...
you need to use innerHTML to be interpreted as code
<div [innerHTML]="custPartyAddress"></div>
edit:
instead using {{custPartyAddress}} you can wrap in another div container using example from above (be carefoul, maybe will be necesarry to apply some styles for new container, example width: 100%)
Try to use Template literals with breaks in your text.

multi-line in aurelia component html attribute property

This is a weird question about possibly embedding a string in an aurelia html file within the attribute tag but I would like to keep my tab and line formatting.
So, in my TS file I have the following:
this.queryDateStart += "type=EntityOne&dateQueryString=";
this.queryDateStart += "" +
"eOr( " +
"eAnd( " +
"eAnd( facetName:isExcluded AND facetValue:No );" +
"dAnd( facetName:deadlineDate AND "+ dateRangePredicate + ");" +
"); " +
"dOr( " +
"(facetName:excludedUntilDate AND "+ dateRangePredicate + ")" +
");" +
");"
And instead of having the following:
<section as-element="ab-deadlines" data-query="${queryDateStart}"></section>
I would like to actually pass the literal string from above.
But with the line spaces.
Would that break anything?
So for example ( going to try this today) - in my html file I would put:
<section as-element="ab-deadlines"
data-query="
eOr(
eAnd(
eAnd( facetName:isExcluded AND facetValue:No );
dAnd( facetName:deadlineDate AND ${dateRangePredicate} );
);
dOr(
(facetName:excludedUntilDate AND + ${dateRangePredicate} )
);
);"></section>
About breaking: it shouldn't break anything. In the end, it's just normal HTML attribute, and as long as the spec allows it, it works in Aurelia, as Aurelia works directly, and plainly with HTML elements.
You can see it yourself at this sandbox https://codesandbox.io/s/z20qx0q263

SSRS Hyperlink dual parameters errors

I am trying to pass a hyperlink in SSRS to open a new SSRS report (in pdf) from a text box. It is currently set up and works passing a single parameter :
="http://servername/ReportServer_REPORTS16/Pages/ReportViewer.aspx?%2fdummy%2fDocuments%2fCertificate+of+Insurance+Issued&rs:Command=Render&PolicyNo="
& Parameters!PolicyNo.Value &"&rs:Format=PDF"
However when I add in the second parameter :
="http://servername/ReportServer_REPORTS16/Pages/ReportViewer.aspx?%2fdummy%2fDocuments%2fCertificate+of+Insurance+Issued&rs:Command=Render&PolicyNo="
& Parameters!PolicyNo.Value &"&
Entitled="&Parameters!Entitled.Value &"&rs:Format=PDF"
I get an error message :
The ActionInfo.Action.Hyperlink expression for the text box
‘Textbox48’ contains an error: [BC30277] Type character '&' does not
match declared data type 'Object'.
I've gone through every similar error I've found on google but cant work out where im going wrong.
You need to convert all your values to strings then use the + operator....
Here'a an exmaple from one of my reports that does the same thing.
=IIF(Fields!PackSizeDesc.Value = Nothing, Nothing,
"http://MyServername/ReportServer?/Brand+Value/_sub+SKU+Price+Details"
+ "&CountryID=" + cStr(Fields!CountryID.Value)
+ "&CategoryID=" + cStr(Fields!CategoryID.Value)
+ "&RecordedPeriodID=" + cStr(Parameters!PeriodID.Value)
+ "&TMB=" + cStr(Fields!TrademarkBrandID.Value)
+ "&PriceStage=" + cStr(IIF(Fields!IsActualprice.Value = 1, 10, 11))
+ "&pm=" + cStr(Fields!PackMaterialID.Value)
+ "&pt=" + cStr(Fields!PackTypeID.Value)
+ "&ps=" + cStr(Fields!PackSizeID.Value)
+ "&psu=" + cStr(Fields!PackSizeUnitID.Value)
+ "&upp=" + cStr(Fields!UnitsPerPack.Value)
+ "&rc:Parameters=Collapsed")
Note: The first line just disables the link if there is now value in a particular column. This does not render to PDF but that's not part of your issue.

Mix html and code asp.net

I'm trying to join two strings but I want them to be divided by a break line.
This is my code:
<td>#(string.Join("<br /> ", report.TimeReportProjects.Select(x => x.Project.ProjectName)))</td>
<td>#(string.Join("<br /> ", report.TimeReportProjects.Select(x => x.Description.Shorten(35))))</td>
<td>#(data.StartHour + ":" + data.StartMinute.ToString("00") + " - " + data.EndHour + ":" + data.EndMinute.ToString("00"))</td>
<td>#(Math.Floor(hours) + ":" + TimeSpan.FromHours(hours).Minutes.ToString("00"))</td>
The "br/>" tag will just be read as a string which is not to strange I assume, I know if i want to mix html code in a code block I should use #: but I am not sure how to use that in this case.
There is a Html.Raw method that should help you. It can be applied like so:
<td>#Html.Raw(string.Join("<br />", report.TimeReportProjects.Select(x => x.Project.ProjectName)))</td>

Including special chars in htmlText

How can I include special characters in htmlText? Specifically, I need to include this symbol: Ø. So far I tried ∅, \u2205 and \u2300, but the symbol is never shown. Copying the char itself only works with text property, so what is the appropriate way to include special chars?
This is my code:
this.text1.htmlText = toHtmlText(s);
function toHtmlText(s:String):String{
return "<font size=\"32\">" +
"\u2205" + // also tried '∅' and '\u2300'
" </font><font size=\"64\">" +
s +
"</font>";
}
try this,
this.text1.htmlText = toHtmlText(s);
function toHtmlText(s:String):String{
return "<font size=\"32\">" +
"\Ø" +
" </font><font size=\"64\">" +
s +
"</font>";
}
find all special characters here: http://dev.w3.org/html5/html-author/charref
Use this following HTML entity:
Ø
You can also go through this link http://www.utexas.edu/learn/html/spchar.html