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

Reuse existing output #1180

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Reuse existing output #1180

wants to merge 2 commits into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Dec 5, 2024

@soyuka my JS skills are very rusty, so there might be a better and less tag dependent way on doing this.

But this allows reusing the existing output for examples if it exists.

Copy link

github-actions bot commented Dec 5, 2024

🚀 Regression report for commit eec67a0 is at https://web-php-regression-report-pr-1180.preview.thephp.foundation

Copy link

github-actions bot commented Dec 5, 2024

🚀 Preview for commit eec67a0 can be found at https://web-php-pr-1180.preview.thephp.foundation

Copy link
Contributor

@soyuka soyuka left a comment

Choose a reason for hiding this comment

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

definitely a good improvement imo, thanks @Girgias

@@ -197,4 +197,4 @@ function.</p></div>
</div>


</div><?php manual_footer(); ?>
</div><?php manual_footer([]); ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

did you meant to commit the manual files?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, because this is needed to be able to test with a local dev setup. Have split it into a different commit so it can easily be merged separately.

But happy to commit this outside of the PR.

lastOutput = createOutput(PHP.buffer.join(""));
phpcode.parentNode.appendChild(lastOutput);
if (exampleScreenPreElement !== null) {
exampleTitleParagraphElement.innerText = "Output of the above example in PHP "+ PHP.version +":";
Copy link
Contributor

Choose a reason for hiding this comment

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

could you maybe store this string in a variable as its used twice?

Comment on lines 28 to 35
array (
0 => 'function.strpbrk.php',
1 => 'strpbrk',
0 => 'ref.strings.php',
1 => 'String Functions',
),
'next' =>
array (
0 => 'function.strrchr.php',
1 => 'strrchr',
0 => 'function.rtrim.php',
1 => 'rtrim',
Copy link
Member

Choose a reason for hiding this comment

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

There's a problem with indentation here.

@sy-records
Copy link
Member

@soyuka Whenever I click Run Code the console outputs:

image

image

@Girgias Girgias force-pushed the reuse-existing-output branch from 03078e4 to 46b1e1f Compare December 5, 2024 11:55
@Girgias
Copy link
Member Author

Girgias commented Dec 5, 2024

@sy-records which page are you encountering this? As I don't have this issue from a quick glance.

@sy-records
Copy link
Member

@Girgias
Copy link
Member Author

Girgias commented Dec 5, 2024

Still nothing on Firefox, even when using the ZH language on the live manual :/

@sy-records
Copy link
Member

I can reproduce it in both Chrome and Firefox.

Firefox

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

Successfully merging this pull request may close these issues.

4 participants