Answer the question
In order to leave comments, you need to log in
A web parser that recognizes possible insertions on any PL on any sites does anyone have an idea how to write?
Good afternoon, the task is to add an input to the site, which will accept absolutely any link and parse the source (presumably these can be articles with some kind of code examples, let's say from habr or medium, or just links to the code, or documents in google docs. That's all whatever.), the parser must recognize the PL that it encounters in order to further wrap this piece in highlighter.js and, in general, isolate the article itself / meaningful text from the link.
Does anyone have an idea how this could be done? The site is written in JS
Answer the question
In order to leave comments, you need to log in
What is the YAP?
$a = 2;
$b = 3;
$c = $a + $b;
print($c);
print("\n");
A person will not always be able to recognize the JP. Accordingly, the answer is "no way".
Here is an interesting article on the topic, but I'm completely off topic.
There was also an idea that to some extent you can use github-linguist
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question