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

@@AUTOID@@ not consistant #44

Open
mattgig opened this issue Jun 30, 2023 · 1 comment
Open

@@AUTOID@@ not consistant #44

mattgig opened this issue Jun 30, 2023 · 1 comment

Comments

@mattgig
Copy link

mattgig commented Jun 30, 2023

When you add an @@autoid@@ to the "body of template X" section and again to the "End tags (template X") section in Moodle 4.2, two different strings are generated.

image

The above template results in two different AUTOIDs:

image

This is contrary to what you would expect, namely the AUTOID to be consistant within the filter area. And it makes selecting corresponding DOM elements very difficult.

Is this the intended behaviour or a bug?

@mattgig mattgig changed the title @@AUTOID@@@ not consistant @@AUTOID@@ not consistant Jun 30, 2023
@justinhunt
Copy link
Owner

Yes you are correct that it is inconsistent. It should not be this way, but I have not yet figured out how to implement it. This is because the start and close tags are treated as two separate filter strings, witjh two separate passes of the filter processing script.

In practice I just do all the processing that requires the @@autoid@@ in the start tag or js, and leave only static html in the end tag. But sometimes that really does make it hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants