Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rendering issues for migrated content #1371

Merged
merged 4 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion base-theme/layouts/partials/external_resource_link.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{{- $text := default .title .text | htmlEscape | page.RenderString -}}
{{- $text := default .title .text -}}
{{- if findRE "^(?:http|https|ftp|mailto)" $text -}}
{{ $text = (replace $text "/" "\\/") }}
{{ end }}
{{- $href := default "" .external_url -}}
{{- $isBroken := default false .is_broken -}}
{{- $backupUrl := default "" .backup_url -}}
Expand Down
2 changes: 1 addition & 1 deletion course-v2/layouts/partials/course_description.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h4 class="course-detail-title">
</h4>
{{ if $shouldCollapseDescription }}
<div id="collapsed-description" class="description">
{{- .context.RenderString (truncate 320 $courseData.course_description) -}}
{{- truncate 320 (.context.RenderString $courseData.course_description) -}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Truncating description before resolving shortcodes breaks the shortcodes. The order has been changes here to first render content (i.e. shortcodes) then truncate the output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Do you think this will fix this recently reported bug, https://github.com/mitodl/hq/issues/3858 ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this was my fault in #876. @pdpinch I was able to confirm that this will fix https://github.com/mitodl/hq/issues/3858.

{{- partial "link_button.html" (dict "text" "Show more" "id" "expand-description") -}}
</div>
<div id="expanded-description" class="description d-none">
Expand Down
Loading