Skip to content

Commit

Permalink
[GitHubGistBridge] fix use the css selector "contains" to find a clas…
Browse files Browse the repository at this point in the history
…s in the middle of the utility classes (#2306)
  • Loading branch information
fmachen authored Oct 29, 2021
1 parent 1c6532a commit 4187d8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bridges/GitHubGistBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public function collectData() {

$html = defaultLinkTo($html, $this->getURI());

$fileinfo = $html->find('[class="file-info"]', 0)
$fileinfo = $html->find('[class~="file-info"]', 0)
or returnServerError('Could not find file info!');

$this->filename = $fileinfo->plaintext;

$comments = $html->find('div[class="timeline-comment-wrapper"]');
$comments = $html->find('div[class~="TimelineItem"]');

if(is_null($comments)) { // no comments yet
return;
Expand All @@ -72,7 +72,7 @@ public function collectData() {
$uri = $comment->find('a[href*=#gistcomment]', 0)
or returnServerError('Could not find comment anchor!');

$title = $comment->find('div[class="unminimized-comment"] h3[class="timeline-comment-header-text"]', 0)
$title = $comment->find('div[class~="unminimized-comment"] h3[class~="timeline-comment-header-text"]', 0)
or returnServerError('Could not find comment header text!');

$datetime = $comment->find('[datetime]', 0)
Expand All @@ -81,7 +81,7 @@ public function collectData() {
$author = $comment->find('a.author', 0)
or returnServerError('Could not find author name!');

$message = $comment->find('[class="comment-body"]', 0)
$message = $comment->find('[class~="comment-body"]', 0)
or returnServerError('Could not find comment body!');

$item = array();
Expand Down

0 comments on commit 4187d8f

Please sign in to comment.