We are managing CQ5 groups using the REST interface. To add a user we do
POST http://$host:$port/home/groups/t/test_group.rw.html
Content-Type: application/x-www-form-urlencoded
addMembers:my_principal_name
which works as expected as long as the the name contains ASCII characters only.
We tried to use latin 1 (ISO-8859-1). For example for a principal name ü:
POST http://$host:$port/home/groups/t/test_group.rw.html
Content-Type: application/x-www-form-urlencoded
addMembers:%FC
In this case no error is generated but the principal is not added.
Our workaround is to use UTF-8 and URL-encode it twice. ü is C3BC, URL-encoded it becomes %C3%BC and encoded another time %25C3%25BC
Summarizing, to add a member ü we have to submit
POST http://$host:$port/home/groups/t/test_group.rw.html
Content-Type: application/x-www-form-urlencoded
addMembers:%25C3%25BC
which works as expected.
Is this a bug or the API really requires to send UTF-8-encoded strings URL encoded twice?
Edit I tried with the additional _charset_ parameter
telnet ******** 8000
Trying ********...
Connected to ********.
Escape character is '^]'.
POST /home/groups/nethz/lz/06065.rw.html HTTP/1.1
Host: *********:8000
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Authorization: Basic ****************=
_charset_=UTF-8&addMembers=aaaa_testgr%C3%BCppli
HTTP/1.1 200 OK
Connection: Keep-Alive
Server: Day-Servlet-Engine/4.1.44
Content-Type: text/html;charset=UTF-8
Date: Fri, 04 Oct 2013 10:50:19 GMT
Transfer-Encoding: chunked
4f6
<html>
<head>
<title>Content modified /home/groups/nethz/lz/06065</title>
</head>
<body>
<h1>Content modified /home/groups/nethz/lz/06065</h1>
<table>
<tbody>
<tr>
<td>Status</td>
<td><div id="Status">200</div></td>
</tr>
<tr>
<td>Message</td>
<td><div id="Message">OK</div></td>
</tr>
<tr>
<td>Location</td>
<td></td>
</tr>
<tr>
<td>Parent Location</td>
<td></td>
</tr>
<tr>
<td>Path</td>
<td><div id="Path">/home/groups/nethz/lz/06065</div></td>
</tr>
<tr>
<td>Referer</td>
<td></td>
</tr>
<tr>
<td>ChangeLog</td>
<td><div id="ChangeLog"><pre></pre></div></td>
</tr>
</tbody>
</table>
<p>Go Back</p>
<p>Modified Resource</p>
<p>Parent of Modified Resource</p>
</body>
</html>
0
Connection closed by foreign host.
We are getting a status 200 answer, but the subgroup aaaa_testgrüppli (aaa_testgr%C3%BCppli) is not inserted in /home/groups/nethz/lz/06065
Sling gets request encoding from the _charset_ POST parameter. ISO-8859-1 is a fallback value. Try setting this parameter to UTF-8.
Related
I'm trying to convert this piece of html without any css:
<!-- saved from url=(1129)https://00f74ba44bf27c26fa604fec19ae391f1d94b6b867-apidata.googleusercontent.com/download/storage/v1/b/backoffice-pao-export/o/document.html?jk=AFshE3XhuRHA7mtfWHAXotti5kjbdIdwxYMBJwIALdaUHwAd5SAytVpKLo_GL_3G_C4shq09Xmhlh2M5uo4BlheALWF58v-9mdqU7EYAR03iEraa1dZZNG0eu3waNSsxkMoxAHr-_GqZXDUHVNvMrLZnTiO7uYcZzQ2OuWvLl3xnX2ppzF0fZ3Bi1b7Rka7nhlNGmrjYDbWWBbrWRiiMnBNd_QZAK_T0t5XobSXCwlJ90IczJLMgjlDYXdq6UJzlsJQLEBI4MA5Ca1s0x-yhygik9sYOv1yawtyPAmvUfwVThET3b6HEA_tnVShpSes8rLZzAJemRtJ7HAJ0NhasQxwsIwOtmriFl8jhQCbFT7nxlwmnfhnSwTSqCxL9JiBdCTHOEqmHVCfsGAC3j3eiJdFFTncsgwhu2MN9_4DSibiuyc_UjHPPcOHOmbSLQxZFtnY4lL-OMIM4G-iDm5gb2k7_K0icO_-eTpSySqhKsFJroGg9KtzU-Rp8mUjeCeY_oGNWE8u1ndsZnP635pJ3hSzsFhEKK85X-L0BpCKTOH3WEATg7c4cEl-VaIyrEbz5ap4GoKCMo9oV2egcfoM2c2N91ZN5IpuXpAlwBoRf0O0zECZfBHQaVOX5RbNYu1cdB69jWVl52ZHl1q2dkx8pILl7dThSan5GHK3cfnP_0fucOiPLLKTH0KXZdY7y1eH666WyUdIsv4SrXvLHzhASeQp7XV_WjtEbVriylge0iOVdbngznKzVxGOJ5xQCnyr3oFZl_GfDnVxMokx-dBNefPAYCWNu3NrNkvJ1emR1KBlTJjX7OIrmQPjSDX5lx8fejzIB3cstLXeTHFVU-ITkQ4ZadevjoV_mMz3SKUU_chyzQVybYdHt498-1gVLmtlb2Qww3bKMPsOK9i3_h2MxvHiV9Sow6mYzZHV9Q-riCbBEDoRbNo0iyHgjbOjs-UHwQPN0U1bvOvU2RxcS7A&isca=1 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<div id="184981f8-654a-4e90-a0f5-e75d1edaf2ca" class="act">
<div id="b995877a-0d3c-439f-984e-f9f809d124a5" class="footnotes">
<table>
<tbody>
<tr>
<td id="f29aca16-143d-1fc6-8f6a-d2aa116cde25">1</td>
<td>Ezechiel HAVRENNE is a lecturer at the University of Luxembourg on Investment Funds. Views expressed
in this article reflect some of the author’s experience to date on the subject matter. As the
Luxembourg investment fund market continues to develop these views may – and will most likely
continue to – evolve in one way or another. This article should in no way be construed as legal,
business or structuring advice rendered by the author or any other entity, nor should it be
construed as reflecting the views of such entity(ies)
</td>
</tr>
<tr>
<td id="434b1865-a5ea-1f96-b0fa-09ea9e4fb76a">2</td>
<td>The Preqin Quarterly Update: Private Debt, Q3 2020, 7 October 2020, page 12; <a
id="0e11d32d-c25b-65c1-8266-39da10bb62f3"
href="https://www.preqin.com/insights/research/quarterly-updates/preqin-quarterly-update-private-debt-q3-2020"
target="_blank" class="tech_external" rel="noopener">https://www.preqin.com/insights/research/quarterly-updates/preqin-quarterly-update-private-debt-q3-2020</a>
(accessed 15 March 2021). These figures drastically contrast with those reported by Lipper as of
October 2016, whereby “<em>the gross AuM of all funds that invest primarily in loan participations
was approximately USD 218 billon</em>� as mentioned in IOSCO’s final report; IOSCO
FR03/2017, ib., page 4
</td>
</tr>
<tr>
<td id="6bf035e5-d434-1eec-a550-58147bed84a0">3</td>
<td>According to EU recommendation 2003/361, 2 factors determine whether a business is an SME: (i) the
number of employees and (ii) either turnover or balance sheet total. A medium-sized company has up
to 250 employees, a turnover of up to €50 million or a balance sheet total of up to €43 million.
A small-sized company has up to 50 employees & a turnover or balance sheet total of up to €10
million. A micro-company has up to 10 employees & a turnover or balance sheet total of up to
€2 million
</td>
</tr>
<tr>
<td id="5028557e-4efe-1066-9fd4-28809a6d0653">4</td>
<td>For instance, one of the driving forces that has led European jurisdictions to consider permitting
funds to originate loans was the adoption of the EU regulation on European long-term investment
funds allowing funds the origination of loans under certain conditions. As a result, many
jurisdictions in Europe now allow loan originations by funds
</td>
</tr>
<tr>
<td id="cd0ac4df-9139-1c0a-9dd0-c15cca78845a">5</td>
<td>See IOSCO’s final report FR03/2017, <em>Findings of the Survey on Loan Funds</em>, February 2017,
page 4 <a id="76d9ff09-04f9-61a4-a311-2cfee0e19245"
href="https://www.iosco.org/library/pubdocs/pdf/IOSCOPD555.pdf" target="_blank"
class="tech_external" rel="noopener">https://www.iosco.org/library/pubdocs/pdf/IOSCOPD555.pdf</a>
(accessed 13 April 2021)
</td>
</tr>
<tr>
<td id="a0dd548b-cfa4-182c-9472-624a6be46538">6</td>
<td>See the Glossary of Summaries published on EUR-Lex, <a id="3052c250-b9c1-60f7-b36c-45ab06665101"
href="https://eur-lex.europa.eu/summary/glossary/sme.html"
target="_blank" class="tech_external"
rel="noopener">https://eur-lex.europa.eu/summary/glossary/sme.html</a>
(accessed 13 April 2021) as well as the European Commission’s page titled “<em>Access to finance
for SMEs</em>�,<a id="b8b721ff-fd48-67aa-aaac-e5b1d0d02b60"
href="https://ec.europa.eu/growth/access-to-finance_en" target="_blank"
class="tech_external" rel="noopener">
https://ec.europa.eu/growth/access-to-finance_en</a> (accessed 13 April 2021)
</td>
</tr>
<tr>
<td id="d98d8f00-f797-1b37-9540-36713cfdc8a7">7</td>
<td><em>Ib.</em></td>
</tr>
<tr>
<td id="3868e384-a464-1b26-933a-8ec3a95f86d5">8</td>
<td>For more information see <a id="dc357707-f043-68ce-a7bc-c9a5d9d86c7d"
href="https://ec.europa.eu/growth/smes/cosme_en" target="_blank"
class="tech_external" rel="noopener">https://ec.europa.eu/growth/smes/cosme_en</a>
(accessed 13 April 2021)
</td>
</tr>
<tr>
<td id="6766e322-fdf8-16b8-99e4-006e43fdecbd">9</td>
<td>See the European Commission’s page titled “COSME Financial Instruments�, <a
id="62cbd917-994d-6388-b0db-786a5c792685"
href="https://ec.europa.eu/growth/access-to-finance/cosme-financial-instruments_en"
target="_blank" class="tech_external" rel="noopener">https://ec.europa.eu/growth/access-to-finance/cosme-financial-instruments_en</a>
(accessed 13 April 2021)
</td>
</tr>
<tr>
<td id="11773190-b10f-1399-b71f-3a5fcfa5a5fc">10</td>
<td>Even if the eligibility for participation in the COSME LGF programme was extended to Loan
Origination funds it does not appear from the EIF’s register published as at 31 January 2021 that
any would have made the list. See<a id="cf5536ce-bff2-6220-9ed7-e4011b938b0e"
href="https://www.eif.org/what_we_do/guarantees/single_eu_debt_instrument/cosme-loan-facility-growth/cosme_lgf_signatures.pdf"
target="_blank" class="tech_external" rel="noopener">
https://www.eif.org/what_we_do/guarantees/single_eu_debt_instrument/cosme-loan-facility-growth/cosme_lgf_signatures.pdf</a>
(accessed 13 April 2021)
</td>
</tr>
<tr>
<td id="12b455e1-ceff-10b6-ba3d-df5b441fe989">11</td>
<td>Those associated countries include Iceland, Montenegro, Turkey, the Republic of North Macedonia,
Albania, Serbia, Bosnia and Herzegovina, and Kosovo
</td>
</tr>
<tr>
<td id="d8103a16-44fa-1096-8295-d478456b0117">12</td>
<td>Connor Hussey, Luxembourg private debt industry grows 36% from 2019, Private Funds CFO, 3 December
2020, <a id="0facc75b-6776-606c-b47d-e2025d559bf2"
href="https://www.privatefundscfo.com/luxembourg-private-debt-industry-grows-36-2-from-2019"
target="_blank" class="tech_external" rel="noopener">https://www.privatefundscfo.com/luxembourg-private-debt-industry-grows-36-2-from-2019</a>/
(accessed 13 April 2021). These figures should be in line with the then reality based on the 2017
final report of IOSCO whereby it stated that “<em>in Luxembourg, the net AuM of all domestic Loan
Funds (i.e., Funds with their primary activity engaged in lending and across various loan
activities, encompassing also activities such as microfinance, real estate debt or
infrastructure financing) is EUR 37.3 bn, constituting 1% of all domestic Funds</em>�, IOSCO
FR03/2017, ib., page 9
</td>
</tr>
<tr>
<td id="228c3276-de18-1393-9860-66ff5272b741">13</td>
<td>KPMG – ALFI Private Debt Fund Survey 2020, pages 4 and 5, <br><a
id="6d4a0dff-557a-603a-8b28-c47bd843b6b4"
href="https://assets.kpmg/content/dam/kpmg/lu/pdf/private-debt-fund-survey-2020.pdf"
target="_blank" class="tech_external" rel="noopener">https://assets.kpmg/content/dam/kpmg/lu/pdf/private-debt-fund-survey-2020.pdf?</a>utm_source=Sailthru&utm_medium=email&utm_campaign=Loan%20Note%203%20December%202020&utm_term=PDI_LONENOTE_SUBSCRIBER<br>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
But content gets cropped everytime when I run HtmlConverter.convertToPdf() with the html content as a string getting this as result:
However when I remove last tr element, I get expected result:
What do you think is causing this? Is it because table element has too many childs?
--- Question Update ----
So after reading the comment from #CptCave I tried changing the html to this format using word-break css property that's supposed to work in this case:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<style>
.word-break{
word-break: break-all;
}
</style>
</head>
<body>
<div id="b995877a-0d3c-439f-984e-f9f809d124a5" class="footnotes">
<table class="word-break">
<tbody>
<tr>
<td id="7673aebd-bc37-198d-932f-987fb16fb503">94</td>
<td>See ESMA Consultation Paper Guidelines on transaction reporting, reference data, order record
keeping & clock synchronisation, 23 December 2015, ESMA/2015/1909, p. 49; <a
id="5326eab7-02a4-69ec-9069-2d0c8eb5f180"
href="https://www.esma.europa.eu/sites/default/files/library/2015-1909_guidelines_on_transaction_reporting_reference_data_order_record_keeping_and_clock_synchronisation.pdf"
target="_blank" class="tech_external" rel="noopener">https://www.esma.europa.eu/sites/default/files/library/2015-1909_guidelines_on_transaction_reporting_reference_data_order_record_keeping_and_clock_synchronisation.pdf</a>
(accessed on 13 April 2021)
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
However I got this as result:
The solution was to add inline css
*<table style="word-wrap: break-word"/>*
So to accomplish I changed document structure with jsoup before converting it:
Document document = Jsoup.parse(html);
document.getElementsByTag("table").forEach(table -> {
table.attr("style", "word-wrap: break-word");
});
As far as I can see your issue is caused by the lack of word wrapping. Your last table row has a long uninterrupted string: the link with the UTM-tags. If you'd remove the utm-tags from it, the cropping would not persist.
<tr>
<td id="228c3276-de18-1393-9860-66ff5272b741">13</td>
<td>KPMG – ALFI Private Debt Fund Survey 2020, pages 4 and 5, <br><a
id="6d4a0dff-557a-603a-8b28-c47bd843b6b4"
href="https://assets.kpmg/content/dam/kpmg/lu/pdf/private-debt-fund-survey-2020.pdf"
target="_blank" class="tech_external" rel="noopener">https://assets.kpmg/content/dam/kpmg/lu/pdf/private-debt-fund-survey-2020.pdf</a><br>
</td>
</tr>
The more durable solution is to implement word wrapping with CSS with the parameter overflow-wrap set to break-word.
There is a full example of this in the iText KB: https://kb.itextpdf.com/home/it7kb/examples/pdfhtml-support-for-overflow-wrap-word-break-css-properties
I'm sending an html-formatted email with a link like this:
click here
It works fine in most email clients, but for a very small percentage of recipients, they receive a modified link that either removes the "." before "com" or adds a second "." before the com. Like one of these:
click here
click here
I can think of two possible causes
A bug in a mail server or email client
I'm thinking this is the more likely cause. The dot that gets doubled is the first dot on a line (see below), which seems to be part of the SMTP spec ("dot stuffing"). Some server or client is likely processing this incorrectly.
If this is the case, I still don't know how to prevent it from happening.
A formatting error in the email content that I'm sending
I've copied the email as received by gmail below. I've tried to remove unnecessary detail but keep anything that could potentially cause a problem.
Perhaps there is a special character that I should be escaping or encoding in a different way. I've seen conflicting info about whether to use \n or \r\n for line endings so not sure if that is relevant.
I can reformat my email template so that the dot in ".com" won't ever be the first dot on a line, but there could be other dots that could be first on a line.
Any insights would be greatly appreciated. This has been an infuriating bug!
--7322d27723a96e14a03643b49db19027e8314f2950d710d4f12530b99277
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Mime-Version: 1.0
Use this link:
https://www.example.com/123?e=3Duser%40examp=
le.com&c=abcde
--7322d27723a96e14a03643b49db19027e8314f2950d710d4f12530b99277
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
Mime-Version: 1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.=
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml">
<head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8" />
<title></title>
</head>
<body>
<table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" height=3D"100%" id=
=3D"bodyTable" width=3D"100%">
<tbody>
<tr>
<td align=3D"center" valign=3D"top">
<table border=3D"0" cellpadding=3D"20" cellspacing=3D"0" id=3D"emailContain=
er" width=3D"600">
<tbody>
<tr bgcolor=3D"#3d486f">
<td align=3D"center" style=3D"padding:10px 0;">
</td>
</tr>
<tr>
<td valign=3D"top">
<p>Click on this button:</p>
<p align=3D"center" style=3D"margin:20px 0;"><a href=3D"https://www.example=
.com/123?e=3Duser%40example.com&c=abc=
de" style=3D"padding:10px 25px; color:#FFF; text-decoration:none; cu=
rsor:pointer; border-radius:5px; background-color:#3d486f;">Vote</a></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
--7322d27723a96e14a03643b49db19027e8314f2950d710d4f12530b99277--
---Jump down to my edit with a simplistic example---
I have searched Ad Nauseum, and spent hours getting this close, but still not solving my automation problem.
Here's the thing I convert the local paper from the print edition to the online edition through PDF's, the content gets pushed to the website and is not live, until I go in and edit some settings, a lot of these are redundant. so if I can get past this one point I'm golden and can shave literally hours off of the time it takes to do this work.
The paper has twenty or thirty writers, and the one_off_byline can vary a bit here is some examples.
id=id_one_off_byline value="Michael Reid" however it may also look like the these next two or some variation thereoff even.
id=id_one_off_byline value="By Michael Reid"
id=id_one_off_byline value="By Michael Reid - Your Daily Paper"
I have used storeTextPresent to find Michael on the page. however the problem is there is another select value box on the page that contains every writers name in a selection box, which is what I'm actually trying to populate. So here is what I have
<tr>
<td>storeTextPresent</td>
<td>Jeff</td>
<td>IsTextAppears</td>
</tr>
<tr>
<td>gotoIf</td>
<td>${isTextAppears}</td>
<td>Jeff</td>
</tr>
<tr>
<td>storeTextPresent</td>
<td>Graham</td>
<td>IsTextAppears</td>
</tr>
<tr>
<td>gotoIf</td>
<td>${isTextAppears}</td>
<td>Graham</td>
</tr>
<tr>
<td>label</td>
<td>Jeff</td>
</tr>
<tr>
<td>label</td>
<td>Graham</td>
</tr>
Another way to phrase this I hope___
Form Field 1 (ignore syntax, I'm just setting up an example here) the id= is the important part in the two form fields.
<select name="select" id="pick_animal" value="">
< option="the fast cat" id="1">
< option="the fast dog" id="2">
</select>
Form Field 2
<input type="text" id="some_animal" value="the fast cat from dover">
I need to detect that id="some_animal" contains cat
so I can perform an action on the correct option in field 1.
I can do the second part just fine, I just can't detect "cat" in only the input with id "some_animal"
storeTextPresent just looks for cat to exist anywhere on the page. ugh!!
<tr>
<td>storeTextPresent</td>
<td>Jeff</td>
<td>IsTextAppears</td>
</tr>
<tr>
<td>gotoIf</td>
<td>${isTextAppears}==Jeff</td>
<td>Jeff</td>
</tr>
<tr>
<td>goto</td>
<td>END</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>Jeff</td>
<td></td>
</tr>
<tr>
<td>echo</td>
<td>something</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>END</td>
<td></td>
</tr>
Try like this.
I often link to GitHub source code via the #L param in the URI.
e.g. : https://github.com/github/learn.github.com/blob/gh-pages/episodes.yaml#L1
But is there a way to link to lines within a Markdown file?
e.g. https://github.com/github/learn.github.com/blob/gh-pages/README.md#L1 (does not work!)
I know I can link to 'sections', but lines are much better!
e.g. https://github.com/github/learn.github.com/blob/gh-pages/README.md#learngithubcom
As it is currently not possible, I take the next best option: use blame and then highlight the lines, e.g. https://github.com/rails/rails/blame/master/guides/source/configuring.md#L166
Now Supported with ?plain=1
Announced on June 30, 2021, there is now a parameter to disable markdown rendering:
Appending ?plain=1 to the url for any Markdown file will now display the file without rendering. As with other code files, it will also show line numbers, and can be used to link other users to a specific line or lines. For example, appending ?plain=1#L52 will highlight line 52 of a plain text Markdown file.
It sounded like you might want to use line numbers to link to a point in the rendered document. That is still possible, nor is it a standard feature of markdown renders to add line number anchors like that.
For the benefit of the reader: The long answer is yes, it is difficult, but possible.
GitHub allows to inline permalinks to the text portion of Markdown files
However there seems currently to be no way to create such permalinks directly, you must manually create them. As follows:
Display the markdown document
Above the document on the right click on the shortened SHA of the document
(you can use "History" and the commit in question as well)
The commit's diff is shown.
Above the commit on the right click on the the 3 dots ... and select "View file"
Now the Mardown is presented again however it is the permanent variant.
Above the document on the right click on "Blame"
Scroll down to the lines which contain the Markdown representation of the text to cite
Select the line or lines in question
Copy the URL from the address bar of the browser
Paste the URL into the issue etc.
This step is only needed within issues: In the URL replace /blame/ by /blob/
In the preview of the Issue you will see the expected direct citing of the text portion of the Markdown.
Drawback of the /blob/-variant
If you click on the URL, you see the full Markdown in the browser, the text portion is not marked as expected.
This is a limitation on how GitHub handles those URLs.
Drawback of the /blame/-variant
It is plain unreadable because of all those annotations and non-rendering of the Markdown.
Example
Note that I had to clone this example to be able to create an issue:
https://github.com/hilbix/learn.github.com/blob/gh-pages/README.md
Click on the SHA
https://github.com/hilbix/learn.github.com/commit/38034b3aee7f4fb7f46e94b3f9c2b3d3554291ba
"View File"
https://github.com/hilbix/learn.github.com/blob/38034b3aee7f4fb7f46e94b3f9c2b3d3554291ba/README.md
"Blame"
https://github.com/hilbix/learn.github.com/blame/38034b3aee7f4fb7f46e94b3f9c2b3d3554291ba/README.md
Mark some lines
https://github.com/hilbix/learn.github.com/blame/38034b3aee7f4fb7f46e94b3f9c2b3d3554291ba/README.md#L20-L23
Change the URL
https://github.com/github/learn.github.com/blob/38034b3aee7f4fb7f46e94b3f9c2b3d3554291ba/README.md#L20-L23
Paste this URL into some issue
Result: https://github.com/hilbix/learn.github.com/issues/1
This was entered into the issue:
https://github.com/hilbix/learn.github.com/blob/38034b3aee7f4fb7f46e94b3f9c2b3d3554291ba/README.md#L20-L23
see https://stackoverflow.com/a/57202063/490291
This renders to something like
learn.github.com/README.md
Lines 20 to 23 in 38034b3
$ git clone https://github.com/github/learn.github.com
$ cd learn.github.com
$ script/bootstrap
$ jekyll --server
see https://stackoverflow.com/a/57202063/490291
Here is the full HTML of the issue created (sorry, I did not manage to copy the CSS, too):
<td class="d-block comment-body markdown-body js-comment-body">
<p></p><div class="border rounded-1 my-2">
<div class="f6 px-3 py-2 lh-condensed border-bottom bg-gray-light">
<p class="mb-0 text-bold">
learn.github.com/README.md
</p>
<p class="mb-0 text-gray-light">
Lines 20 to 23
in
<a data-pjax="true" class="commit-tease-sha" href="/hilbix/learn.github.com/commit/38034b3aee7f4fb7f46e94b3f9c2b3d3554291ba">38034b3</a>
</p>
</div>
<div itemprop="text" class="blob-wrapper blob-wrapper-embedded data">
<table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8">
<tbody><tr class="border-0">
<td id="L20" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="20"></td>
<td id="LC20" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line"> <span class="pl-s1">$ git clone https://github.com/github/learn.github.com</span> </td>
</tr>
<tr class="border-0">
<td id="L21" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="21"></td>
<td id="LC21" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line"> <span class="pl-s1">$ <span class="pl-c1">cd</span> learn.github.com</span> </td>
</tr>
<tr class="border-0">
<td id="L22" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="22"></td>
<td id="LC22" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line"> <span class="pl-s1">$ script/bootstrap</span> </td>
</tr>
<tr class="border-0">
<td id="L23" class="blob-num border-0 px-3 py-0 bg-white js-line-number" data-line-number="23"></td>
<td id="LC23" class="blob-code border-0 px-3 py-0 bg-white blob-code-inner js-file-line"> <span class="pl-s1">$ jekyll --server</span> </td>
</tr>
</tbody></table>
</div>
</div>
<p></p>
<p>see <a rel="nofollow" href="https://stackoverflow.com/a/57202063/490291">https://stackoverflow.com/a/57202063/490291</a></p>
</td>
I recently looked for the same. Answer is No, as mentioned in other answers.
But I found a good alternative which gives almost the same result we want.
Adding text fragment to url.
For example: https://github.com/github/balanced-employee-ip-agreement#:~:text=FAQ
You just have to append #:~:text={text-that-you-want-to-be-focussed} at the end of the url
read more about text fragment here.
https://wicg.github.io/scroll-to-text-fragment/
Short answer: no. Markdown is rendered into an HTML document by GitHub, so it's not currently possible to see it in a raw form that also allows you to link to individual lines. Maybe GitHub will implement this kind of functionality sometime in the future, but for now, it's not possible.
There's now support for this in the UI
This just dropped: https://twitter.com/github/status/1443572280924147717
Click on README.md in the directory you're looking at
Its URL will look like this: https://github.com/rust-lang/rust/blob/master/README.md
Click the "Display the source blob" button:
The URL will change to https://github.com/rust-lang/rust/blob/master/README.md?plain=1, as described in this answer
You can now click on line numbers and obtain links to these lines
There's still no such button to do this for .rst files, but adding ?plain=1 to the URL works: https://github.com/python/cpython/blob/main/README.rst?plain=1
When you want to link to a line in a file controlled by you, you can use <a>: https://stackoverflow.com/a/6494918/5053865
Example:
<a name="your_link_name">
Some line which you want to link to
</a>
... some wall of text ...
and here you are able to link to [the line](#your_link_name)
Example on GitHub: https://github.com/evis/markdown-link-to-line (it's in readme file).
This way, you can't refer to a line with a given number, but can refer to a line with needed content (which is exactly what you often need).
I am using SIDE 1.3.0 along with FF 6.0.2.
I stored a string using store text command which contains a "URL" by using the following command.
storeText
which results as
MyCode = "<iframe src="http://myportal.com/mysales/Agent/index/4eb29642ce24e8.22143850/embedded" height="650" width="605" frameBorder="0"></iframe>"
I need to have only the URL part in another variable from the string above "http://myportal.com/mysales/Agent/index/4eb29642ce24e8.22334455/embedded"
in order to proceed with the remaining test case. Thanks in advance.
Something like:
<tr>
<td>storeEval</td>
<td>'${MyCode}'.replace(/.*src="(.*?)".*/, $1)</td>
<td>url</td>
</tr>
This will use JavaScript to set a variable called url to the value of the src attribute within your MyCode variable.
The first command below stores the href attribute of any element, you can modify it to your needs.
The third command uses javascript to get the pathname attribute of the DOM object.
Hope this answers your question.
If you open the IDE click on the source tab in the main window and copy and paste the code below between the tags, you'll be able to run the test on this page, or any other stack overflow page.
<tr>
<td>storeAttribute</td>
<td>css=.profile-link#href</td>
<td>href</td>
</tr>
<tr>
<td>echo</td>
<td>${href}</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>this.browserbot.getUserWindow().document.getElementsByClassName('profile-link')[0].pathname</td>
<td>pathname</td>
</tr>
<tr>
<td>echo</td>
<td>${pathname}</td>
<td></td>
</tr>