I'm developing a project based on a wiki. One of its functionality is assigning anchors to heading (h1. h2.,etc) and I want to link a word to one of this anchors so when it's clicked the page automatically scrolls down to the correct heading. As it says on the help page the anchor should be used as following:
Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.
And then adds:
[[Guide#further-reading]] takes you to the anchor "further-reading". Headings get automatically assigned anchors so that you can refer to them
So I tried to use it by writing [[LBAW#Glossario]], or [[LBAW"#Glossario"]] or
[[LBAW#"Glossario"]]....none of them worked creating a new page each time instead of scrolling down as it should.
If anyone could give any advised I would be very much appreciated.
I had the same problem and figured it out. The anchor link ("click me") format looks like:
[[your_wiki_pagename#the-anchor|click me]]
the link will bring you to wiki page ("your_wiki_pagename"):
h2. the anchor
You need to replace the space in anchor text with "-" (the anchor -> the-anchor).
I have tried it in the current demo of redmine and it works. http://demo.redmine.org/projects/anewproject/wiki/Headers
Assume the following text on the page called Headers:
h1. Headers
some text
This link goes to [[Headers#header2]]
h2. header2
some
more
lines
of
text
to
see
scrolling
You can check the exact name of the anchor which Redmine has added by looking at the page source, or inspecting the element using browser tools.
I had the same problem but I hadn't put the exact name in, using the same case. My heading was:
DNS (moved to separate page)
and so Redmine created an anchor like this:
ΒΆ
so I had to use the following link:
[[Server_Configuration#DNS-moved-to-separate-page]]
and that worked.
Related
I am trying to replace URLs in text by an actual HTML URL... UNLESS it's already an HTML URL. I am working on resigning a forum that allowed users to enter HTML, so savvy users have already typed in full URL...
So this should get replaced.
I have found this cool link: http://www.cool-link.com
But this one should be left alone:
I have found this cool link: http://www.cool-link.com
So is there a way to replace "http://..." by a hyperlink, UNLESS said URL is preceded by href=" or in between < and >.
EDIT: The various solutions I found online (including on stackoverflow) would replace both of the above, and I cannot for the life of me change the pattern to meet my needs.
Cheers :)
Alix
The following regex should do it:
/(?<!(href=\")|(\>))(https?:\/\/.+\b)/gi
See it working here: https://regexr.com/4hnns
A have a client who has an ecommerce website working on Wix. She asked me to setup the conversion funnel so she could identify when visitors leave a step, I mean, those who don't get to the order placed page. On Wix, we have 3 steps/urls, as below:
Cart: https://www.easyhomedesign.com.br/cart?appSectionParams=%7B%22origin%22%3A%22cart-popup%22%7D
Checkout: https://www.easyhomedesign.com.br/checkout?appSectionParams=%7B%22a11y%22%3Afalse%2C%22cartId%22%3A%2283476f86-4ac9-44ac-8779-4479dde12cc2%22%2C%22storeUrl%22%3A%22https%3A%2F%2Fwww.easyhomedesign.com.br%2F%22%2C%22isFastFlow%22%3Afalse%2C%22isPickupFlow%22%3Afalse%7D
and the Thank you page: https://www.easyhomedesign.com.br/thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17
After each of those urls, we have dynamic string values, so I need to put into the funnel step, on the url field, those same urls but using a regex that matches to the config "starts with", since we can't know what the values on the end of the urls are and, on the funnel setup section, we don't have that combobox "Starts with". At least, that's the only solution I could think about.
Then, my idea is use something like https://www.easyhomedesign.com.br/thank-you-page/$. I don't know regex, that's only an example of what I thought about, since that part of the url is the fixed one.
Could someone help me? tks.
Although the final goal setup highly depends on your Analyitcs implementation, it is basically possible to cover such funnel with RegEx in goal funnels.
Google Analytics tracks page visits with path, buy default. So https://www.easyhomedesign.com.br/thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17 will become /thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17 in your reports. It can be set up to contain the domain, and the goal flow can be created as well, but it's important to check, how the RegEx should be created.
It is also important, if the above mentioned query parts are affecting the step, whether they are part of the flow or not.
Assuming that the path part is relevant, you can set up something like this.
Cart URL in reports: /cart?appSectionParams=%7B%22origin%22%3A%22cart-popup%22%7D
Cart step RegEx in goal flow: ^\/cart
^ stands for beginning of the string, but you might need to adjust, if host is present in your reports. You can also extend it to ^\/cart\?, if you expect any parameters to be present, to qualify for cart visit.
Checkout URL in reports: /checkout?appSectionParams=%7B%22a11y%22%3Afalse%2C%22cartId%22%3A%2283476f86-4ac9-44ac-8779-4479dde12cc2%22%2C%22storeUrl%22%3A%22https%3A%2F%2Fwww.easyhomedesign.com.br%2F%22%2C%22isFastFlow%22%3Afalse%2C%22isPickupFlow%22%3Afalse%7D
Checkout Cart step RegEx in goal flow: ^\/checkout
The same applies for checkout step for beginning of the string, or for any parameters required.
Thank you URL in reports: /thank-you-page/d28bc342-0afe-40cb-8d98-a5784b6b2f17
Thank you RegEx, which is essentially the goal's RegEx: ^\/thank-you-page\/[\w-]+
Here, the [\w-]+ part expects alphanumerical characters, underscore, or hyphen to be present. More precisely, one or more must exist there.
The $ sign, mentioned in the OP, could not be used here, as it indicates the end of the string, and therefore the id at the end of the URL would make it non-matching.
Unfortunately my blog was hacked and 1000+ posts have been infected with links to spam sites. As part of the cleaning process I'm trying to use a regex to find and replace the bad links in an XML file in Sublime Text.
The only consistency I can see is all the bad links contain an inline style changing the text colour to #676c6c, so I'm trying but failing to create a regular expression that can highlight all anchor tags containing this hex value - #676c6c
<a[\s]+([^>]+)>((?:.(?!\<\/a\>))*.)</a>
So far I've got this, which I believe highlights all anchor tags, can anyone help expand this to include anchors containing #676c6c between the first angled brackets? Here's an example of one of the bad links
spam keyword
I appreciate any help! Cheers.
Maybe you could use <a[^>]+#676c6c[^>]+>[^<]*<\/a>.
Try it out here.
If the anchor tag may contain other tags, use (?s)<a[^>]+#676c6c[^>]+>.*?<\/a> instead.
I have the following text
http://www.faz.net/aktuell/politik/ausland/amerika/venezuela-das-ende-der-sozialistischen-epoche-13952597.html
http://www.faz.net/aktuell/politik/ausland/bundeswehr-einsatz-von-der-leyen-gesteht-fehler-in-afghanistan-ein-13952438.html
http://www.faz.net/aktuell/politik/inland/bayerns-ehrenamtliche-in-der-fluechtlingskrise-13948777.html
I would like to retrieve only those links that start with http://www.faz.net/aktuell/politik/ but end with .html with only one slash in between. Basically, avoiding the first link in the list above.
I tried the following
http://www.faz.net/aktuell/politik/.*/.*?\.html
However, all get selected. How do avoid the extra slash in the first? Please help
You can use the following:
http://www\.faz\.net/aktuell/politik/[^/]*/[^/]*\.html
See DEMO
I want to extract URLs from a webpage these are just URLs by themselves not hyperlinks etc., they are just text. Some examples would be http://www.example.com, http://example.com, www.example.com etc. I am extremely new at regex so I have copy and pasted like 20 expressions online all failed to work. I don't know if I am doing it right or not. Any help would be really appreciated.
I wrote a post on using Regex to locate links within a HTML page (the intent was to use JavaScript to open external links or links to documents such as PDF's etc in a popup window).
The final regex was:
^(?:[./]+)?(?:Assets|https?://(?!(?:www.)?integralist))
The full post is here:
http://www.integralist.co.uk/javascript/regular-expression-to-open-external-links-in-popup-window/
The solution wont be perfect but might help point you in the right direction.
Mark
You're probably not escaping your .s. You need to use \. for each one.
Take a look at strfriend.com. It has a URL example, and represents it graphically.
The example it suggests is:
^((ht|f)tp(s?)://|~/|/)?(\w+:\w+#)?([a-zA-Z]{1}([\w-]+.)+(\w{2,5}))(:\d{1,5})?((/?\w+/)+|/?)(\w+.\w{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?