From 1843b1e8d19acf8688bbb7981d9d75eae4f1378b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 5 Apr 2024 09:04:39 +1100 Subject: [emacs] fix gitlab parsing --- emacs/.emacs.d/lisp/my/my-gitlab.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/my-gitlab.el') diff --git a/emacs/.emacs.d/lisp/my/my-gitlab.el b/emacs/.emacs.d/lisp/my/my-gitlab.el index a25533f..6dd484c 100644 --- a/emacs/.emacs.d/lisp/my/my-gitlab.el +++ b/emacs/.emacs.d/lisp/my/my-gitlab.el @@ -30,9 +30,10 @@ (defun my-get-gitlab-project-id (url) (with-current-buffer (url-retrieve-synchronously (replace-regexp-in-string "\\.git$" "" url)) - (goto-char (point-min)) - (when (re-search-forward "Project ID: \\([0-9]+\\)" nil t) - (match-string 1)))) + (let ((dom (libxml-parse-html-region (point-min) (point-max)))) + (dom-attr (car + (dom-search dom (lambda (n) (dom-attr n 'data-project-id)))) + 'data-project-id)))) (defun my-grok-gitlab (url) (when-let* ((urlobj (url-generic-parse-url url)) -- cgit v1.2.3