Skip to content

Commit

Permalink
fix view links in pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Doris Lam committed Jun 17, 2023
1 parent 1cf7674 commit 6af11e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ve-utils/application/Utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class UtilsService {
if (type === 'figure') {
prefix = 'Figure ' + veNumber + '. ';
const capFig = el.find('figure > figcaption');
name = capFig.text();
name = capFig.text().trim();
if (name !== '' && name.indexOf('Figure') === 0 && name.split('. ').length > 0) {
name = name.substring(name.indexOf(prefix) + prefix.length);
} else if (name === '') {
Expand Down Expand Up @@ -402,8 +402,8 @@ export class UtilsService {
* @returns {void} nothing
*/
public convertViewLinks(printElement: JQuery<HTMLElement>): void {
printElement.find('mms-view-link').each((index) => {
const $this = $(this);
printElement.find('mms-view-link').each((index, el) => {
const $this = $(el);
let elementId = $this.attr('mms-element-id') || $this.attr('data-mms-element-id');
if (!elementId) {
return;
Expand Down

0 comments on commit 6af11e4

Please sign in to comment.