html2md/extended/base/
iframe.rs

1use regex::Regex;
2
3lazy_static::lazy_static! {
4    /// Pattern that detects iframes with Youtube embedded videos<br/>
5    /// Examples:
6    /// * `https://www.youtube.com/embed/zE-dmXZp3nU?wmode=opaque`
7    /// * `https://www.youtube-nocookie.com/embed/5yo6exIypkY`
8    /// * `https://www.youtube.com/embed/TXm6IXrbQuM`
9    pub(crate) static ref YOUTUBE_PATTERN : Regex = Regex::new(r"www\.youtube(?:-nocookie)?\.com/embed/([-\w]+)").expect("valid regex pattern");
10
11    /// Pattern that detects iframes with Instagram embedded photos<br/>
12    /// Examples:
13    /// * `https://www.instagram.com/p/B1BKr9Wo8YX/embed/`
14    /// * `https://www.instagram.com/p/BpKjlo-B4uI/embed/`
15    pub(crate) static ref INSTAGRAM_PATTERN: Regex = Regex::new(r"www\.instagram\.com/p/([-\w]+)/embed").expect("valid regex pattern");
16
17    /// Patter that detects iframes with VKontakte embedded videos<br/>
18    /// Examples:
19    /// * `https://vk.com/video_ext.php?oid=-49423435&id=456245092&hash=e1611aefe899c4f8`
20    /// * `https://vk.com/video_ext.php?oid=-76477496&id=456239454&hash=ebfdc2d386617b97`
21    pub(crate) static ref VK_PATTERN: Regex = Regex::new(r"vk\.com/video_ext\.php\?oid=(-?\d+)&id=(\d+)&hash=(.*)").expect("valid regex pattern");
22}